/* Sucasa — clean, neutral UI. One accent color, system font, light borders, generous spacing. */
:root {
  /* palette: White #FCFCFC · Tomato #F06543 · Gunmetal #313638 · Sunflower Gold #E6AF2E */
  --bg: #f2f2f1;
  --surface: #fcfcfc;
  --text: #313638;
  --text-2: #4f5558;
  --muted: #73797c;
  --border: #e3e3e1;
  --border-strong: #cfd0ce;
  --tomato: #f06543;
  --tomato-hover: #e2522f;
  --accent: #c4472a;        /* tomato darkened for readable text on light backgrounds */
  --accent-soft: #fdeee9;
  --gold: #e6af2e;
  --gold-soft: #fbf1d9;
  --gold-ink: #7a5a0c;
  --ink: #313638;           /* primary buttons */
  --ink-hover: #1f2325;
  --danger: #c4472a;
  --pos: #2f7d4f;
  --neg: #c4472a;
  --img: #efefed;           /* background behind house drawings */
  --img-ink: #7d8284;       /* line color of house drawings */
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 2px rgba(49, 54, 56, .06);
  --shadow-md: 0 4px 16px rgba(49, 54, 56, .1);
  --font: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --head: 64px;
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--text); font: 15px/1.55 var(--font); -webkit-font-smoothing: antialiased; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .4em; font-weight: 650; letter-spacing: -.01em; }
h1 { font-size: 1.6rem; }
h2 { font-size: 1.15rem; }
h3 { font-size: 1rem; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--tomato); outline-offset: 2px; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.center { text-align: center; }
.grow { flex: 1; min-width: 0; }
.row { display: flex; gap: 8px; align-items: center; }
.pos { color: var(--pos); } .neg { color: var(--neg); }

/* ------------------------------------------------------------- buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; cursor: pointer;
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--text);
  padding: 8px 14px; border-radius: var(--radius-sm); font-weight: 550; font-size: .9rem; line-height: 1.2;
  transition: background .12s, border-color .12s;
}
.btn:hover { background: #f4f4f5; text-decoration: none; }
.btn.primary { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn.primary:hover { background: var(--ink-hover); border-color: var(--ink-hover); }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.ghost:hover { background: #f0f0f2; }
.btn.sm { padding: 6px 12px; font-size: .85rem; }
.btn.wide { width: 100%; padding: 10px; }
.link { background: none; border: 0; padding: 0; color: var(--accent); font-weight: 550; cursor: pointer; font-size: .88rem; }
.link:hover { text-decoration: underline; }
.link.danger { color: var(--danger); }
.link.danger.confirm { color: #fff; background: var(--danger); padding: 1px 8px; border-radius: 6px; text-decoration: none; }

/* ------------------------------------------------------------- top bar */
.topbar {
  position: sticky; top: 0; z-index: 1000; display: flex; align-items: center; gap: 24px;
  height: 64px; padding: 0 20px; background: var(--surface); border-bottom: 1px solid var(--border);
  border-top: 3px solid var(--tomato);
}
.brand { font-family: 'Pacifico', cursive; font-size: 1.75rem; line-height: 1; color: var(--tomato); padding-bottom: 4px; }
.brand:hover { text-decoration: none; color: var(--tomato-hover); }
.nav { display: flex; gap: 2px; }
.nav a { color: var(--text-2); font-weight: 550; font-size: .92rem; padding: 8px 12px; border-radius: var(--radius-sm); white-space: nowrap; }
.nav a:hover { background: #f4f4f5; color: var(--text); text-decoration: none; }
.nav a.on { color: var(--accent); background: var(--accent-soft); }
.search {
  flex: 1; max-width: 400px; margin-left: auto; display: flex; align-items: center; gap: 8px;
  background: #ececea; border: 1px solid transparent; border-radius: var(--radius-sm); padding: 0 12px;
}
.search:focus-within { background: #fff; border-color: var(--tomato); }
.search svg { width: 16px; height: 16px; color: var(--muted); flex: none; }
.search input { border: 0; background: transparent; outline: 0; padding: 9px 0; width: 100%; font-size: .92rem; }
.account { display: flex; gap: 6px; align-items: center; }
.me { display: flex; align-items: center; gap: 8px; color: var(--text); font-weight: 550; font-size: .92rem; padding: 4px 8px 4px 4px; border-radius: var(--radius-sm); }
.me:hover { background: #f4f4f5; text-decoration: none; }

.avatar {
  display: inline-grid; place-items: center; flex: none; width: 30px; height: 30px; border-radius: 50%;
  background: var(--accent-soft); color: var(--accent); font-weight: 650; font-size: .85rem;
}
.avatar.xs { width: 22px; height: 22px; font-size: .7rem; }
.avatar.sm { width: 28px; height: 28px; font-size: .8rem; }
.avatar.xl { width: 72px; height: 72px; font-size: 1.8rem; }
.avatar.ghost { background: #f0f0f2; color: var(--muted); }

/* ------------------------------------------------------------- explore */
.explore { display: grid; grid-template-columns: minmax(400px, 50%) 1fr; height: calc(100vh - var(--head)); }
.panel { overflow-y: auto; padding: 20px 20px 48px; }
.panel-head { margin-bottom: 14px; }
.panel-head h1 { margin-bottom: 4px; }
.panel-head p { margin: 0; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
select {
  appearance: none; cursor: pointer; font-size: .88rem; font-weight: 500;
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm); padding: 7px 30px 7px 12px;
  background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' stroke='%2371717a' stroke-width='1.6' fill='none'/%3E%3C/svg%3E") no-repeat right 10px center / 10px;
}
select:hover { border-color: #a1a1aa; }
.sorts { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 2px; margin-bottom: 10px; scrollbar-width: none; }
.sorts button {
  border: 1px solid var(--border); background: var(--surface); padding: 5px 12px; border-radius: 999px;
  font-size: .84rem; font-weight: 500; cursor: pointer; white-space: nowrap; color: var(--text-2);
}
.sorts button:hover { border-color: var(--border-strong); color: var(--text); }
.sorts button.on { background: var(--text); border-color: var(--text); color: #fff; }
.results-head { display: flex; justify-content: space-between; align-items: center; margin: 4px 0 12px; font-size: .88rem; color: var(--text-2); }
.results-head #count { font-weight: 600; color: var(--text); }
.toggle { display: flex; align-items: center; gap: 6px; cursor: pointer; }
.toggle input { accent-color: var(--tomato); margin: 0; }
.results, .grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }

.map-wrap { position: relative; border-left: 1px solid var(--border); }
.map-note {
  position: absolute; z-index: 500; top: 12px; left: 50%; transform: translateX(-50%); white-space: nowrap;
  background: var(--surface); border: 1px solid var(--border-strong); border-radius: 999px; padding: 5px 14px;
  font-size: .84rem; color: var(--text-2); box-shadow: var(--shadow-md); pointer-events: none;
}
.map-note[hidden] { display: none; }
.btn.more { grid-column: 1 / -1; justify-self: center; margin-top: 6px; }
.map { position: absolute; inset: 0; background: #e9ecef; }
.leaflet-container { font-family: var(--font); }
.leaflet-tile-pane { filter: saturate(.6) contrast(.95) brightness(1.04); } /* calmer basemap; pins stay vivid */
.leaflet-bar { border: 1px solid var(--border-strong) !important; box-shadow: var(--shadow) !important; border-radius: var(--radius-sm) !important; overflow: hidden; }

/* ------------------------------------------------------------- cards */
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden;
  cursor: pointer; transition: box-shadow .15s, border-color .15s;
}
.card { transition: box-shadow .2s, border-color .2s, transform .2s; }
.card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.card-img { overflow: hidden; }
.card-img .photo { transition: opacity .3s, transform .5s ease; }
.card:hover .card-img .photo.ok { transform: scale(1.04); }
.card:hover .price { color: var(--accent); }
.card.focus { border-color: var(--tomato); box-shadow: 0 0 0 1px var(--tomato); }
.card-img, .hero, .sc-img, .mini-img, .feed-thumb { --paper: var(--img); background: var(--img); color: var(--img-ink); }
.card-img { position: relative; aspect-ratio: 400 / 230; }
.card-img svg { width: 100%; height: 100%; display: block; }
.card-body { padding: 10px 14px 12px; }
.card-top { display: flex; align-items: center; gap: 8px; }
.price { font-weight: 700; font-size: 1.2rem; color: var(--text); letter-spacing: -.01em; }
a.price:hover { text-decoration: none; color: var(--accent); }
.cut { font-size: .78rem; font-weight: 600; color: var(--gold-ink); background: var(--gold-soft); padding: 1px 7px; border-radius: 999px; white-space: nowrap; }
.facts { color: var(--text-2); font-size: .86rem; margin-top: 2px; }
.facts b { color: var(--text); font-weight: 600; }
.facts.lg { font-size: .95rem; }
.addr { color: var(--muted); font-size: .86rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.addr.lg { white-space: normal; font-size: .95rem; }
.card-foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: 8px; min-height: 24px; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; overflow: hidden; max-height: 24px; }
.chip { font-size: .75rem; font-weight: 500; padding: 2px 8px; border-radius: 999px; background: #f4f4f5; color: var(--text-2); white-space: nowrap; }
.chip b { font-weight: 600; color: var(--muted); margin-left: 4px; }
.chip.tone-good { background: var(--gold-soft); color: var(--gold-ink); }
.chip.tone-bad { background: var(--accent-soft); color: var(--accent); }
.chip.tone-good b, .chip.tone-bad b { color: inherit; opacity: .7; }
.cc { font-size: .8rem; color: var(--muted); white-space: nowrap; }

.status {
  position: absolute; top: 10px; left: 10px; font-size: .75rem; font-weight: 600; padding: 3px 9px;
  border-radius: 999px; background: rgba(255, 255, 255, .95); color: var(--text-2); border: 1px solid var(--border);
}
.status.st-pending { color: var(--gold-ink); }
.status.st-coming-soon, .status.st-new-construction { color: var(--accent); }
.status.st-foreclosure, .status.st-short-sale { color: var(--danger); }

.card-img .photo { z-index: 1; }
.card-img .status, .card-img .heart { z-index: 2; }
.heart {
  position: absolute; top: 8px; right: 8px; width: 34px; height: 34px; border-radius: 50%; cursor: pointer;
  border: 1px solid var(--border); background: rgba(255, 255, 255, .95); display: grid; place-items: center;
}
.heart svg { width: 18px; height: 18px; fill: none; stroke: var(--text-2); stroke-width: 1.8; }
.heart:hover svg { stroke: var(--text); }
.heart.on svg { fill: var(--tomato); stroke: var(--tomato); }
.head-actions .heart { position: static; }

/* ------------------------------------------------------------- votes */
.vote { display: inline-flex; align-items: center; border: 1px solid var(--border); border-radius: 999px; flex: none; background: var(--surface); }
.vote.v { flex-direction: column; border: 0; background: none; }
.vote button { border: 0; background: none; cursor: pointer; color: var(--muted); font-size: .72rem; padding: 4px 8px; line-height: 1; border-radius: 999px; }
.vote button:hover { color: var(--text); background: #f4f4f5; }
.vote .up.on { color: var(--tomato); }
.vote .down.on { color: var(--text); }
.vote .score.pop { animation: pop .3s ease; }
@keyframes pop { 50% { transform: scale(1.35); } }
.heart.on svg { animation: heartpop .35s ease; }
@keyframes heartpop { 40% { transform: scale(1.3); } }
.vote .score { min-width: 18px; text-align: center; font-weight: 600; font-size: .85rem; font-variant-numeric: tabular-nums; }
.vote.lg button { font-size: .9rem; padding: 7px 11px; }
.vote.lg .score { font-size: 1.05rem; min-width: 28px; }
.vote.sm button { font-size: .66rem; padding: 2px 6px; }
.vote.sm .score { font-size: .8rem; }

/* ------------------------------------------------------------- map pins */
.pin-wrap { background: none; border: 0; }
.pin {
  position: absolute; transform: translate(-50%, calc(-100% - 6px)); white-space: nowrap; cursor: pointer;
  background: var(--surface); color: var(--text); border: 1px solid var(--border-strong); border-radius: 999px;
  font-weight: 600; font-size: .76rem; padding: 2px 8px; box-shadow: 0 1px 3px rgba(0, 0, 0, .15);
}
.pin::after {
  content: ''; position: absolute; left: 50%; top: 100%; transform: translateX(-50%);
  border: 5px solid transparent; border-bottom: 0; border-top-color: var(--surface);
  filter: drop-shadow(0 1px 0 var(--border-strong));
}
.pin.hot { background: var(--ink); border-color: var(--ink); color: #fff; }
.pin.hot::after { border-top-color: var(--ink); filter: none; }
.pin-wrap.focus .pin::after, .pin:hover::after { border-top-color: var(--tomato); filter: none; }
.pin.cold { color: var(--muted); }
.pin-wrap.focus .pin, .pin:hover { background: var(--tomato); border-color: var(--tomato); color: #fff; z-index: 10; }
.leaflet-popup-content-wrapper { border-radius: var(--radius); padding: 0; overflow: hidden; box-shadow: var(--shadow-md); }
.leaflet-popup-content { margin: 0; width: 260px !important; }
.popup .card { border: 0; border-radius: 0; }
.popup .card:hover { box-shadow: none; }

/* ------------------------------------------------------------- listing page */
.home-page, .page { max-width: 1120px; margin: 0 auto; padding: 20px 20px 64px; }
.back { display: inline-block; margin-bottom: 12px; font-size: .9rem; font-weight: 550; }
.hero { position: relative; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border); }
.hero svg { width: 100%; max-height: 340px; display: block; padding-top: 12px; }
.hero .status { top: 14px; left: 14px; z-index: 2; }
.photo { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .3s; }
.photo.ok { opacity: 1; }
.hero.has-photo > svg { visibility: hidden; }
.hero.has-photo::before {
  content: ''; position: absolute; inset: -30px; background: var(--photo) center / cover;
  filter: blur(28px) brightness(.85); transform: scale(1.05);
}
.hero .photo { left: 50%; right: auto; width: auto; max-width: 100%; aspect-ratio: 16 / 10; transform: translateX(-50%); }
.photo-note {
  display: none; position: absolute; right: 10px; bottom: 10px; z-index: 2; font-size: .72rem; color: #fff;
  background: rgba(49, 54, 56, .7); padding: 2px 8px; border-radius: 999px;
}
.photo.ok + .photo-note { display: block; }
.sc-img .status { position: absolute; z-index: 2; }
.home-grid { display: grid; grid-template-columns: 1fr 320px; gap: 20px; margin-top: 20px; align-items: start; }
.block { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 20px; margin-bottom: 16px; }
.home-head { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; flex-wrap: wrap; margin-bottom: 16px; }
.big-price { font-size: 2rem; font-weight: 700; margin: 0 0 4px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.big-price .cut { font-size: .85rem; }
.home-head .muted.small { margin: -2px 0 4px; }
.head-actions { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.ratio { font-size: .82rem; color: var(--muted); }
.sec { font-size: 1rem; font-weight: 650; margin-bottom: 8px; }
.block > p.muted.small { margin-top: -2px; }
.desc { color: var(--text-2); margin: 0 0 4px; }
.facts-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 14px 0 0; }
.facts-grid div { background: #fafafa; border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 8px 12px; }
.facts-grid dt { font-size: .76rem; color: var(--muted); }
.facts-grid dd { margin: 1px 0 0; font-weight: 600; }
.attribution { margin: 14px 0 0; font-size: .78rem; color: var(--muted); }

.stamp-picker { display: flex; flex-wrap: wrap; gap: 8px; }
.stamp-btn {
  display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-size: .86rem; font-weight: 500;
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--text-2); border-radius: 999px; padding: 6px 12px;
}
.stamp-btn b { font-weight: 600; color: var(--muted); font-size: .8rem; }
.stamp-btn:hover { border-color: #a1a1aa; color: var(--text); }
.stamp-btn.on { background: var(--accent-soft); border-color: var(--tomato); color: var(--accent); }
.stamp-btn.on b { color: var(--accent); }
.stamp-btn.on.tone-good { background: var(--gold-soft); border-color: var(--gold); color: var(--gold-ink); }
.stamp-btn.on.tone-good b { color: var(--gold-ink); }
.stamp-btn.on.tone-warn { background: #ececea; border-color: var(--text-2); color: var(--text); }
.stamp-btn.on.tone-warn b { color: var(--text); }

/* crowd estimate */
.crowd p { margin: 0 0 8px; }
.guess-out { display: block; text-align: center; font-size: 1.8rem; font-weight: 700; margin: 6px 0; }
.guess-out.under { color: var(--neg); } .guess-out.over { color: var(--pos); }
input[type=range] { width: 100%; accent-color: var(--tomato); }
.range-labels { display: flex; justify-content: space-between; font-size: .76rem; color: var(--muted); margin-bottom: 12px; }
.crowd-num { font-size: 1.8rem; font-weight: 700; line-height: 1.15; }
.crowd-num small { display: block; font-size: .8rem; font-weight: 400; color: var(--muted); }
.crowd.reveal .crowd-num { animation: fade .4s ease-out; }
@keyframes fade { from { opacity: 0; transform: translateY(4px); } }
.verdict { margin: 8px 0 4px; }
.gauge { position: relative; height: 62px; margin: 6px 4px; }
.gauge .track { position: absolute; left: 0; right: 0; top: 29px; height: 4px; border-radius: 999px; background: #e4e4e7; }
.gauge .mk { position: absolute; top: 0; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; font-size: .72rem; font-weight: 550; color: var(--text-2); }
.gauge .mk i { width: 12px; height: 12px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 0 0 1px var(--border-strong); margin-top: 25px; order: 2; }
.gauge .mk em { font-style: normal; position: absolute; top: 4px; white-space: nowrap; }
.gauge .mk.you em { top: 44px; }
.gauge .ask i { background: var(--text-2); } .gauge .crowd i { background: var(--tomato); } .gauge .you i { background: var(--gold); }

.map-block .minimap { height: 200px; border-radius: var(--radius-sm); overflow: hidden; }
.minis { display: flex; flex-direction: column; gap: 2px; }
.mini { display: flex; gap: 10px; align-items: center; padding: 6px; margin: 0 -6px; border-radius: var(--radius-sm); color: var(--text); }
.mini:hover { background: #f4f4f5; text-decoration: none; }
.mini-img { width: 64px; height: 44px; flex: none; border-radius: 6px; overflow: hidden; }
.mini-img svg { width: 100%; height: 100%; display: block; }
.mini-txt { font-size: .9rem; min-width: 0; flex: 1; line-height: 1.3; }
.mini-txt b { margin-right: 4px; }
.mini-txt small { display: block; color: var(--muted); font-size: .78rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rank { font-weight: 650; color: var(--muted); width: 20px; text-align: center; flex: none; font-variant-numeric: tabular-nums; }
.split { display: flex; margin-top: 4px; font-size: .72rem; font-weight: 550; border-radius: 999px; overflow: hidden; }
.split .u { background: var(--accent-soft); color: var(--accent); padding: 0 6px; min-width: fit-content; }
.split .d { background: #ececea; color: var(--text-2); padding: 0 6px; text-align: right; min-width: fit-content; }

/* comments */
.talk-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 8px; }
.talk-head .sec { margin: 0; }
.talk-head .count { font-size: .8rem; font-weight: 550; color: var(--muted); background: #f4f4f5; padding: 1px 8px; border-radius: 999px; margin-left: 4px; }
.seg { display: inline-flex; background: #f4f4f5; border-radius: var(--radius-sm); padding: 3px; }
.seg button { border: 0; background: none; border-radius: 6px; padding: 4px 12px; font-size: .84rem; font-weight: 550; cursor: pointer; color: var(--text-2); }
.seg button.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.tabs { margin: 16px 0 12px; }
.composer { display: flex; gap: 10px; margin: 8px 0 14px; }
textarea { width: 100%; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); padding: 10px 12px; resize: vertical; background: var(--surface); }
textarea:focus { outline: 0; border-color: var(--tomato); box-shadow: 0 0 0 3px var(--accent-soft); }
.composer-foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 6px; }
.composer-cta { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; background: #fafafa; border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px 14px; margin: 8px 0 14px; color: var(--text-2); }
.comment { display: flex; gap: 6px; padding: 10px 0 0; }
.comments > .comment + .comment { border-top: 1px solid var(--border); margin-top: 6px; }
.comment.flash > .c-main > .c-body { animation: flash 2s; }
@keyframes flash { 0%, 40% { background: var(--accent-soft); } }
.vote-spacer { width: 26px; flex: none; }
.c-main { flex: 1; min-width: 0; }
.c-meta { display: flex; align-items: center; gap: 6px; font-size: .84rem; }
.c-meta a { color: var(--text); font-weight: 600; }
.dot { color: var(--border-strong); }
.c-body { margin: 3px 0 4px; overflow-wrap: anywhere; border-radius: 6px; }
.c-actions { display: flex; gap: 14px; }
.c-actions .link { font-size: .8rem; color: var(--muted); font-weight: 500; }
.c-actions .link:hover { color: var(--text); }
.children { border-left: 2px solid var(--border); padding-left: 12px; margin-top: 4px; }
.children .children .children .children { padding-left: 6px; }
.reply-form { margin: 8px 0; }
.reply-form .row { justify-content: flex-end; margin-top: 6px; }

/* ------------------------------------------------------------- quick vote */
.swipe-page { max-width: 460px; margin: 0 auto; padding: 24px 16px 56px; }
.swipe-head { text-align: center; margin-bottom: 14px; }
.swipe-head p { margin: 0; }
.card-deck { position: relative; min-height: 440px; margin-bottom: 16px; }
.swipe-card {
  --casa: 0; --nada: 0; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--shadow-md); touch-action: pan-y; user-select: none; cursor: grab; transition: transform .25s ease, opacity .25s;
}
.swipe-card:active { cursor: grabbing; }
.swipe-card.fly-right { transform: translateX(130%) rotate(12deg) !important; opacity: 0; }
.swipe-card.fly-left { transform: translateX(-130%) rotate(-12deg) !important; opacity: 0; }
.swipe-card.fly-up { transform: translateY(-40%) !important; opacity: 0; }
.sc-img { position: relative; aspect-ratio: 400 / 230; }
.sc-img svg { width: 100%; height: 100%; display: block; pointer-events: none; }
.sc-label { position: absolute; top: 16px; font-weight: 700; font-size: 1.2rem; padding: 4px 12px; border-radius: 999px; color: #fff; }
.sc-label.casa { right: 16px; background: var(--tomato); opacity: var(--casa); }
.sc-label.nada { left: 16px; background: var(--ink); opacity: var(--nada); }
.sc-body { padding: 14px 18px 18px; }
.sc-body .price { font-size: 1.5rem; }
.sc-body .desc { font-size: .92rem; margin: 10px 0; }
.sc-body .chips { margin-bottom: 10px; max-height: none; }
.swipe-btns { display: flex; justify-content: center; gap: 10px; }
.round { flex: 1; max-width: 150px; border: 1px solid var(--border-strong); background: var(--surface); border-radius: var(--radius-sm); padding: 11px; cursor: pointer; font-weight: 600; }
.round:hover { background: #f4f4f5; }
.round.casa { background: var(--ink); border-color: var(--ink); color: #fff; }
.round.casa:hover { background: var(--ink-hover); }
.round.skip { max-width: 90px; color: var(--muted); }
#judged { font-size: .85rem; margin-top: 12px; }

/* ------------------------------------------------------------- activity / leaderboard / profile */
.two-col { display: grid; grid-template-columns: 1fr 320px; gap: 24px; align-items: start; }
.feed { display: flex; flex-direction: column; gap: 10px; margin-top: 14px; }
.feed-item { display: flex; gap: 14px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px; color: var(--text); }
.feed-item:hover { border-color: var(--border-strong); text-decoration: none; box-shadow: var(--shadow); }
.feed-thumb { width: 96px; height: 62px; flex: none; border-radius: var(--radius-sm); overflow: hidden; }
.feed-thumb svg { width: 100%; height: 100%; display: block; }
.feed-txt { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.feed-meta { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: .84rem; color: var(--text-2); }
.feed-meta b { color: var(--text); font-weight: 600; }
.feed-body { overflow-wrap: anywhere; color: var(--text); }

.boards { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; margin-top: 16px; }
.board { list-style: none; margin: 0; padding: 0; }
.board li { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--border); }
.board li:last-child { border-bottom: 0; }
.board li a { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; color: var(--text); }
.board li a:hover { text-decoration: none; }
.board li a span { display: flex; flex-direction: column; line-height: 1.25; }
.board small { color: var(--muted); font-size: .78rem; }
.board .num { font-weight: 650; font-variant-numeric: tabular-nums; }
.ladder ul { list-style: none; margin: 0; padding: 0; }
.ladder li { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid var(--border); }
.ladder li:last-child { border-bottom: 0; }
.ladder li span { color: var(--muted); font-size: .85rem; }

.profile { display: flex; gap: 20px; align-items: center; flex-wrap: wrap; }
.profile h1 { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 2px; }
.title-badge { font-size: .76rem; font-weight: 600; color: var(--gold-ink); background: var(--gold-soft); padding: 2px 9px; border-radius: 999px; }
.bio { margin: 6px 0 2px; color: var(--text-2); }
.bio-form { max-width: 460px; margin-top: 8px; } .bio-form .row { margin-top: 6px; }
.stats { display: flex; gap: 8px; flex-wrap: wrap; }
.stats div { background: #fafafa; border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 8px 14px; text-align: center; min-width: 76px; }
.stats b { display: block; font-size: 1.2rem; font-weight: 650; }
.stats span { font-size: .76rem; color: var(--muted); }

/* ------------------------------------------------------------- accents */
.accent-title span { color: var(--accent); }
.accent-title::after, .page h1::after, .swipe-head h1::after {
  content: ''; display: block; width: 40px; height: 4px; border-radius: 2px; background: var(--gold); margin-top: 8px;
}
.swipe-head h1::after { margin: 8px auto 0; }
.profile h1::after { display: none; }

.skel {
  background: linear-gradient(90deg, #ececea 25%, #f6f6f5 37%, #ececea 63%); background-size: 400% 100%;
  animation: shimmer 1.3s ease infinite;
}
.skel-card { pointer-events: none; }
.skel-card .card-img { aspect-ratio: 400 / 230; }
.skel.line { height: 12px; border-radius: 6px; margin: 8px 0; }
.skel.w50 { width: 50%; height: 18px; } .skel.w80 { width: 80%; } .skel.w60 { width: 60%; }
@keyframes shimmer { from { background-position: 100% 50%; } to { background-position: 0 50%; } }

.site-foot {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 14px; padding: 28px 20px 36px;
  border-top: 1px solid var(--border); color: var(--text-2); font-size: .85rem; max-width: 1120px; margin: 0 auto;
}
.site-foot .muted { flex-basis: 100%; font-size: .78rem; }
.brand.sm { font-size: 1.25rem; padding: 0; }
body[data-view="explore"] .site-foot { display: none; }

/* ------------------------------------------------------------- misc */
.empty { text-align: center; padding: 48px 16px; color: var(--text-2); grid-column: 1 / -1; }
.empty h2 { font-size: 1.05rem; }
.empty.small { padding: 20px 8px; color: var(--muted); }
.loading { text-align: center; padding: 48px 16px; color: var(--muted); grid-column: 1 / -1; }

#toast {
  position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 16px); opacity: 0; pointer-events: none; z-index: 3000;
  background: var(--text); color: #fff; padding: 10px 16px; border-radius: var(--radius-sm); font-size: .9rem; font-weight: 500;
  box-shadow: var(--shadow-md); transition: transform .2s, opacity .2s; max-width: calc(100vw - 32px);
}
#toast.show { opacity: 1; transform: translate(-50%, 0); }

dialog.auth { border: 0; border-radius: var(--radius); padding: 0; width: min(380px, calc(100vw - 32px)); background: var(--surface); color: var(--text); box-shadow: 0 20px 50px rgba(0, 0, 0, .2); }
dialog.auth::backdrop { background: rgba(24, 24, 27, .4); }
.auth form { padding: 24px; position: relative; display: flex; flex-direction: column; gap: 12px; }
.auth .x { position: absolute; top: 12px; right: 12px; width: 32px; height: 32px; border: 0; border-radius: var(--radius-sm); background: none; font-size: 1.4rem; line-height: 1; cursor: pointer; color: var(--muted); }
.auth .x:hover { background: #f4f4f5; color: var(--text); }
.auth h2 { font-size: 1.3rem; margin: 0; }
.auth p { margin: 0; }
.auth label { display: flex; flex-direction: column; gap: 4px; font-weight: 550; font-size: .88rem; }
.auth input { border: 1px solid var(--border-strong); border-radius: var(--radius-sm); padding: 9px 12px; background: var(--surface); }
.auth input:focus { outline: 0; border-color: var(--tomato); box-shadow: 0 0 0 3px var(--accent-soft); }
.err { color: var(--danger); font-size: .86rem; min-height: 1.2em; }
.switch { font-size: .9rem; color: var(--text-2); text-align: center; }

/* ------------------------------------------------------------- responsive */
@media (max-width: 1000px) {
  .home-grid, .two-col { grid-template-columns: 1fr; }
  .nav a { padding: 8px 9px; }
}
@media (max-width: 860px) {
  .topbar { height: auto; flex-wrap: wrap; gap: 8px 12px; padding: 10px 16px; }
  .account { margin-left: auto; }
  .search { order: 3; max-width: none; flex-basis: 100%; margin-left: 0; }
  .nav { order: 4; flex-basis: 100%; overflow-x: auto; scrollbar-width: none; }
  .explore { display: flex; flex-direction: column-reverse; height: auto; }
  .map-wrap { height: 300px; border-left: 0; border-bottom: 1px solid var(--border); }
  .panel { overflow: visible; padding: 16px; }
  .home-page, .page { padding: 16px 16px 48px; }
  .big-price { font-size: 1.6rem; }
  .head-actions { align-items: flex-start; }
  .facts-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 480px) {
  .me span { display: none; }
  .results, .grid { grid-template-columns: 1fr; }
  .feed-thumb { width: 72px; height: 48px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
