:root {
  --navy: #0d2b4e;
  --navy-2: #163d6b;
  --red: #cf142b;
  --red-dark: #a80f22;
  --bg: #f2f4f5;
  --surface: #ffffff;
  --text: #1b2430;
  --muted: #5d6b7a;
  --border: #d9dee3;
  --sale: #0b7a4b;
  --rent: #1f5fbf;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(13, 43, 78, .06), 0 4px 14px rgba(13, 43, 78, .06);
  --font: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
main { flex: 1; }
img { max-width: 100%; display: block; }
h1, h2, h3 { line-height: 1.25; margin: 0 0 .5rem; }
p { margin: 0 0 .75rem; }
a { color: inherit; }
:focus-visible { outline: 3px solid #4d9fff; outline-offset: 2px; }

.container { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 16px; }
.container.narrow { max-width: 820px; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.link { color: var(--navy-2); font-weight: 600; text-decoration: none; }
.link:hover { text-decoration: underline; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  padding: .55rem 1rem; border-radius: 8px; border: 2px solid transparent;
  font: inherit; font-weight: 600; text-decoration: none; cursor: pointer;
  white-space: nowrap; transition: background .15s, border-color .15s, color .15s;
}
.btn-lg { padding: .75rem 1.4rem; font-size: 1.05rem; }
.btn-block { width: 100%; }
.btn-primary { background: var(--navy); color: #fff; }
.btn-primary:hover { background: var(--navy-2); }
.btn-accent { background: var(--red); color: #fff; }
.btn-accent:hover { background: var(--red-dark); }
.btn-outline { background: #fff; color: var(--navy); border-color: var(--navy); }
.btn-outline:hover { background: var(--navy); color: #fff; }
.btn-outline-light { color: #fff; border-color: rgba(255, 255, 255, .7); }
.btn-outline-light:hover { background: #fff; color: var(--navy); }
.btn-ghost { background: transparent; color: var(--navy); border-color: var(--border); }
.btn-ghost:hover { background: #e7ebef; }

/* ---------- navbar ---------- */
.navbar { background: var(--navy); color: #fff; position: sticky; top: 0; z-index: 20; }
.nav-inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 64px; flex-wrap: wrap; padding-top: 8px; padding-bottom: 8px; }
.brand { display: inline-flex; align-items: center; gap: .5rem; font-size: 1.4rem; font-weight: 800; text-decoration: none; letter-spacing: -.02em; }
.brand-mark { width: 30px; height: 30px; fill: var(--red); background: #fff; border-radius: 8px; padding: 4px; }
.nav-actions { display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; }
.nav-link { background: none; border: 0; color: #fff; font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; padding: .4rem .2rem; }
.nav-link:hover { text-decoration: underline; }
.nav-user { color: rgba(255, 255, 255, .85); }
.inline-form { display: inline; margin: 0; }

.lang-switch { display: inline-flex; border: 1px solid rgba(255, 255, 255, .45); border-radius: 999px; overflow: hidden; }
.lang-switch a { padding: .25rem .7rem; font-size: .85rem; font-weight: 700; text-decoration: none; color: rgba(255, 255, 255, .85); }
.lang-switch a:hover { background: rgba(255, 255, 255, .12); }
.lang-switch a.active { background: #fff; color: var(--navy); }

/* ---------- flash ---------- */
.flash { margin: 1rem 0; padding: .8rem 1rem; border-radius: var(--radius); font-weight: 600; border-left: 5px solid; }
.flash-success { background: #e6f6ee; color: #0a5a37; border-color: var(--sale); }
.flash-info { background: #e8f0fb; color: #173f7a; border-color: var(--rent); }
.flash-error { background: #fdecee; color: #8c0f1f; border-color: var(--red); }

/* ---------- hero + search ---------- */
.hero { background: linear-gradient(160deg, var(--navy) 0%, var(--navy-2) 100%); color: #fff; padding: 2.5rem 0 3rem; }
.hero h1 { font-size: clamp(1.6rem, 4vw, 2.4rem); }
.hero > .container > p { color: rgba(255, 255, 255, .85); font-size: 1.1rem; }
.search-card { background: var(--surface); color: var(--text); border-radius: 14px; padding: 1rem; margin-top: 1.25rem; box-shadow: 0 10px 30px rgba(0, 0, 0, .2); }
.search-main { display: grid; grid-template-columns: 1fr 260px auto; gap: .6rem; }
input, select, textarea {
  font: inherit; color: var(--text); width: 100%;
  padding: .65rem .8rem; border: 1px solid var(--border); border-radius: 8px; background: #fff;
}
input:focus, select:focus, textarea:focus { border-color: var(--navy-2); outline: 2px solid rgba(22, 61, 107, .2); }
[aria-invalid="true"] { border-color: var(--red); }

.filters { margin-top: .75rem; }
.filters summary { cursor: pointer; font-weight: 700; color: var(--navy-2); width: max-content; }
.filters-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: .75rem; margin-top: .75rem; }
.filters-grid label span { display: block; font-size: .85rem; font-weight: 600; color: var(--muted); margin-bottom: .2rem; }
.filters-actions { display: flex; justify-content: flex-end; gap: .5rem; margin-top: .9rem; }

/* ---------- results ---------- */
.results { padding-top: 2rem; padding-bottom: 3rem; }
.results-head { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; margin-bottom: 1rem; }
.results-head h2 { font-size: 1.4rem; }
.card-grid { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1.1rem; }
.card { display: flex; flex-direction: column; height: 100%; background: var(--surface); border-radius: var(--radius); overflow: hidden; text-decoration: none; box-shadow: var(--shadow); transition: transform .15s, box-shadow .15s; }
.card:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(13, 43, 78, .14); }
.card-media { position: relative; aspect-ratio: 4 / 3; background: #dfe5ea; }
.card-media img { width: 100%; height: 100%; object-fit: cover; }
.no-photo { display: grid; place-items: center; width: 100%; height: 100%; color: var(--muted); font-weight: 600; background: #dfe5ea; min-height: 200px; }
.badge { display: inline-block; padding: .2rem .6rem; border-radius: 999px; font-size: .78rem; font-weight: 700; color: #fff; }
.badge-sale { background: var(--sale); }
.badge-rent { background: var(--rent); }
.card-media .badge { position: absolute; top: .6rem; left: .6rem; }
.photo-count { position: absolute; bottom: .6rem; right: .6rem; display: inline-flex; align-items: center; gap: .25rem; background: rgba(0, 0, 0, .65); color: #fff; font-size: .8rem; font-weight: 600; padding: .15rem .5rem; border-radius: 6px; }
.photo-count svg { width: 15px; height: 15px; fill: none; stroke: #fff; stroke-width: 2; }
.card-body { padding: .9rem 1rem 1rem; display: flex; flex-direction: column; flex: 1; }
.card-price { font-size: 1.3rem; font-weight: 800; color: var(--navy); margin-bottom: .2rem; }
.card-price small, .listing-price small { font-size: .9rem; font-weight: 600; color: var(--muted); }
.card-title { font-size: 1rem; font-weight: 600; margin-bottom: .3rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card-meta { color: var(--muted); font-size: .9rem; margin-bottom: .6rem; }
.card-foot { margin: auto 0 0; display: flex; justify-content: space-between; gap: .5rem; font-size: .82rem; color: var(--muted); border-top: 1px solid #eef1f3; padding-top: .6rem; }
.empty-state { background: var(--surface); border-radius: var(--radius); padding: 3rem 1rem; text-align: center; color: var(--muted); box-shadow: var(--shadow); }
.pagination { display: flex; justify-content: space-between; align-items: center; margin-top: 2rem; }

/* ---------- panels / forms ---------- */
.panel { background: var(--surface); border-radius: var(--radius); padding: 1.25rem; box-shadow: var(--shadow); margin-bottom: 1rem; }
.panel h2 { font-size: 1.15rem; }
.form-page, .auth-page, .listing-page { padding-top: 1.75rem; padding-bottom: 3rem; }
.form-page > h1 { font-size: 1.8rem; }
fieldset.panel { border: 0; margin: 0 0 1rem; min-width: 0; }
fieldset.panel legend { float: left; width: 100%; font-size: 1.15rem; font-weight: 700; margin-bottom: 1rem; padding: 0; }
fieldset.panel legend + * { clear: left; }
.field { margin-bottom: 1rem; }
.field > label, .field > .label { display: block; font-weight: 600; margin-bottom: .3rem; }
.optional { font-weight: 400; color: var(--muted); font-size: .85rem; }
.hint { font-size: .85rem; color: var(--muted); margin: .3rem 0 0; }
.hint.warn { color: #8a5a00; }
.field-error { color: var(--red-dark); font-size: .88rem; font-weight: 600; margin: .3rem 0 0; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.field-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 1rem; }
textarea { resize: vertical; min-height: 150px; }
.form-actions { display: flex; justify-content: flex-end; gap: .75rem; }
.stack > * + * { margin-top: .25rem; }

.segmented { display: flex; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.segmented label { flex: 1; position: relative; cursor: pointer; }
.segmented input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.segmented span { display: block; text-align: center; padding: .62rem .5rem; font-weight: 600; }
.segmented label + label span { border-left: 1px solid var(--border); }
.segmented input:checked + span { background: var(--navy); color: #fff; }
.segmented input:focus-visible + span { outline: 3px solid #4d9fff; outline-offset: -3px; }

.dropzone { display: flex; flex-direction: column; align-items: center; gap: .6rem; padding: 1.6rem 1rem; border: 2px dashed var(--border); border-radius: var(--radius); background: #f8fafb; cursor: pointer; text-align: center; margin-top: .75rem; transition: border-color .15s, background .15s; }
.dropzone:hover, .dropzone.dragover { border-color: var(--navy-2); background: #eef3f9; }
.dropzone svg { width: 40px; height: 40px; fill: none; stroke: var(--navy-2); stroke-width: 1.5; }
.dropzone input[type="file"] { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.photo-preview { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: .6rem; margin-top: .75rem; }
.thumb { position: relative; margin: 0; aspect-ratio: 1; border-radius: 8px; overflow: hidden; background: #dfe5ea; }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb-cover { position: absolute; left: .35rem; bottom: .35rem; background: var(--red); color: #fff; font-size: .72rem; font-weight: 700; padding: .1rem .45rem; border-radius: 4px; }
.thumb-remove { position: absolute; top: .3rem; right: .3rem; width: 28px; height: 28px; border-radius: 50%; border: 0; background: rgba(0, 0, 0, .7); color: #fff; font-size: 1.1rem; line-height: 1; cursor: pointer; }
.thumb-remove:hover { background: var(--red); }

/* ---------- auth ---------- */
.auth-card { max-width: 440px; margin: 0 auto; padding: 2rem; }
.auth-card h1 { font-size: 1.6rem; }
.auth-switch { text-align: center; margin: 1.25rem 0 0; }

/* ---------- listing detail ---------- */
.back-link { display: inline-block; margin-bottom: 1rem; }
.listing-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 1.25rem; align-items: start; }
.gallery { background: var(--surface); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); margin-bottom: 1rem; }
.gallery-main { position: relative; aspect-ratio: 16 / 10; background: #111; }
.gallery-main img { width: 100%; height: 100%; object-fit: contain; }
.gallery-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 44px; height: 44px; border-radius: 50%; border: 0; background: rgba(255, 255, 255, .9); font-size: 1.8rem; line-height: 1; cursor: pointer; color: var(--navy); }
.gallery-nav:hover { background: #fff; }
.gallery-nav.prev { left: .75rem; }
.gallery-nav.next { right: .75rem; }
.gallery-counter { position: absolute; bottom: .75rem; right: .75rem; background: rgba(0, 0, 0, .65); color: #fff; padding: .15rem .55rem; border-radius: 6px; font-size: .85rem; }
.gallery-thumbs { display: flex; gap: .5rem; padding: .6rem; overflow-x: auto; }
.gallery-thumbs button { flex: 0 0 84px; height: 64px; padding: 0; border: 3px solid transparent; border-radius: 6px; overflow: hidden; cursor: pointer; background: none; opacity: .7; }
.gallery-thumbs button.active { border-color: var(--red); opacity: 1; }
.gallery-thumbs img { width: 100%; height: 100%; object-fit: cover; }
.listing-title { font-size: 1.6rem; }
.listing-price { font-size: 1.9rem; font-weight: 800; color: var(--navy); margin-bottom: .6rem; }
.chips { display: flex; flex-wrap: wrap; gap: .5rem; }
.chip { background: #eef1f4; padding: .2rem .7rem; border-radius: 999px; font-size: .85rem; font-weight: 600; }
.specs { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: .75rem; margin: 0; }
.specs div { background: #f6f8fa; padding: .65rem .8rem; border-radius: 8px; }
.specs dt { font-size: .8rem; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .03em; }
.specs dd { margin: 0; font-weight: 700; }
.description { white-space: pre-line; overflow-wrap: anywhere; }
.listing-side { position: sticky; top: 84px; }
.contact-card .btn { margin-top: .6rem; overflow: hidden; text-overflow: ellipsis; }
.seller { display: flex; align-items: center; gap: .75rem; margin: .5rem 0 .75rem; }
.seller p { margin: 0; }
.avatar { width: 48px; height: 48px; border-radius: 50%; background: var(--navy); color: #fff; display: grid; place-items: center; font-weight: 800; font-size: 1.3rem; flex: none; }

/* ---------- error / footer ---------- */
.error-page { text-align: center; padding-top: 4rem; padding-bottom: 4rem; }
.error-code { font-size: 4rem; font-weight: 800; color: var(--red); margin: 0; }
.site-footer { background: var(--navy); color: rgba(255, 255, 255, .85); padding: 1.5rem 0; margin-top: 2rem; }
.footer-inner { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; align-items: center; }
.footer-inner p { margin: 0; }
.site-footer .muted { color: rgba(255, 255, 255, .6); }

/* ---------- utilities ---------- */
.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; }
.mono { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; letter-spacing: .04em; }
.btn-sm { padding: .35rem .7rem; font-size: .9rem; }
.btn-danger-outline { background: #fff; color: var(--red-dark); border-color: #f1b8bf; }
.btn-danger-outline:hover { background: var(--red); color: #fff; border-color: var(--red); }
.pill { display: inline-block; background: var(--red); color: #fff; font-size: .75rem; font-weight: 700; border-radius: 999px; padding: .05rem .5rem; white-space: nowrap; }
.page { padding-top: 1.75rem; padding-bottom: 3rem; }
.page-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-bottom: 1rem; flex-wrap: wrap; }
.page-head h1 { font-size: 1.8rem; margin: 0; }
.subhead { font-size: 1rem; margin: 1rem 0 .25rem; }

/* ---------- navbar extras ---------- */
.nav-icon { position: relative; display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; color: #fff; }
.nav-icon:hover { background: rgba(255, 255, 255, .12); }
.nav-icon svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linejoin: round; }
.nav-badge { position: absolute; top: 2px; right: 0; min-width: 18px; height: 18px; padding: 0 4px; border-radius: 9px; background: var(--red); color: #fff; font-size: .7rem; font-weight: 800; display: grid; place-items: center; border: 2px solid var(--navy); }
.user-menu { position: relative; }
.user-menu summary { list-style: none; display: flex; align-items: center; gap: .4rem; cursor: pointer; padding: .25rem .4rem; border-radius: 999px; }
.user-menu summary::-webkit-details-marker { display: none; }
.user-menu summary:hover { background: rgba(255, 255, 255, .12); }
.user-menu .menu { position: absolute; right: 0; top: calc(100% + 8px); min-width: 230px; background: #fff; color: var(--text); border-radius: var(--radius); box-shadow: 0 12px 32px rgba(0, 0, 0, .2); padding: .4rem; z-index: 30; }
.menu-head { padding: .5rem .7rem .6rem; margin: 0 0 .3rem; border-bottom: 1px solid #eef1f3; font-weight: 600; overflow-wrap: anywhere; }
.menu a, .menu button { display: flex; justify-content: space-between; align-items: center; width: 100%; padding: .55rem .7rem; border-radius: 6px; text-decoration: none; font: inherit; color: inherit; background: none; border: 0; cursor: pointer; text-align: left; }
.menu a:hover, .menu button:hover { background: #f1f4f7; }
.menu form { margin: .3rem 0 0; border-top: 1px solid #eef1f3; padding-top: .3rem; }
.avatar-sm { width: 30px; height: 30px; font-size: .9rem; background: #fff; color: var(--navy); }

/* ---------- favourites ---------- */
.card-wrap { position: relative; }
.fav-form { margin: 0; }
.fav-card { position: absolute; top: .5rem; right: .5rem; }
.fav-btn { display: inline-flex; align-items: center; gap: .4rem; border: 0; cursor: pointer; font: inherit; font-weight: 600; color: var(--text); }
.fav-btn svg { width: 22px; height: 22px; fill: none; stroke: var(--red); stroke-width: 2; transition: fill .15s, transform .15s; }
.fav-btn.active svg { fill: var(--red); }
.fav-btn:active svg { transform: scale(.85); }
.fav-card .fav-btn { width: 38px; height: 38px; justify-content: center; border-radius: 50%; background: rgba(255, 255, 255, .95); box-shadow: 0 1px 4px rgba(0, 0, 0, .2); }
.fav-inline .fav-btn { background: #fff; border: 1px solid var(--border); border-radius: 999px; padding: .35rem .8rem; font-size: .9rem; }
.fav-inline .fav-btn:hover { border-color: var(--red); }
.title-row { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; flex-wrap: wrap; }

/* ---------- contact card ---------- */
.contact-card form { margin: 0; }
.message-form { margin-top: .75rem; }
.message-form textarea { min-height: 100px; }
.phone-number { display: block; text-align: center; font-weight: 700; font-size: 1.1rem; margin-top: .5rem; letter-spacing: .03em; }

/* ---------- maps ---------- */
.map { height: 320px; border-radius: 8px; overflow: hidden; background: #dfe5ea; z-index: 0; }
.map-picker { height: 360px; margin: .75rem 0; cursor: crosshair; }

/* ---------- listing form: existing photos ---------- */
.thumb.existing { cursor: pointer; }
.thumb-check { position: absolute; left: 0; right: 0; bottom: 0; display: flex; align-items: center; gap: .35rem; padding: .3rem .5rem; background: rgba(0, 0, 0, .65); color: #fff; font-size: .8rem; font-weight: 600; }
.thumb-check input { width: auto; margin: 0; }
.thumb.existing .thumb-cover { bottom: auto; top: .35rem; }
.thumb.removing img { opacity: .3; filter: grayscale(1); }
.thumb.removing .thumb-check { background: var(--red); }

/* ---------- recovery key ---------- */
.recovery-card { text-align: center; }
.recovery-icon { font-size: 2.5rem; }
.recovery-key { font-size: 1.35rem; font-weight: 800; background: #fff8e1; border: 2px dashed #e0b84a; border-radius: 10px; padding: 1rem; margin: 1rem 0; user-select: all; overflow-wrap: anywhere; }
.recovery-actions { display: flex; gap: .5rem; justify-content: center; flex-wrap: wrap; margin-bottom: .75rem; }
.recovery-card .btn-block { margin-top: 1rem; }

/* ---------- my listings ---------- */
.row-list { list-style: none; padding: 0; margin: 0; }
.row-item { display: grid; grid-template-columns: 140px 1fr auto; gap: 1rem; align-items: center; }
.row-thumb { display: block; width: 140px; height: 105px; border-radius: 8px; overflow: hidden; background: #dfe5ea; flex: none; }
.row-thumb.small { width: 64px; height: 64px; }
.row-thumb img { width: 100%; height: 100%; object-fit: cover; }
.row-thumb .no-photo { min-height: 0; }
.row-body { min-width: 0; }
.row-body p { margin: 0 0 .25rem; }
.row-title { font-weight: 700; text-decoration: none; display: block; margin-bottom: .2rem; }
.row-title:hover { text-decoration: underline; }
.row-actions { display: flex; flex-direction: column; gap: .4rem; }
.row-actions form { margin: 0; }
.row-actions .btn { width: 100%; }

/* ---------- inbox ---------- */
.inbox { list-style: none; padding: 0; margin: 0; background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.inbox li + li { border-top: 1px solid #eef1f3; }
.inbox-item { display: flex; align-items: center; gap: .9rem; padding: .9rem 1rem; text-decoration: none; }
.inbox-item:hover { background: #f8fafb; }
.inbox-item.unread { background: #f3f7fd; }
.inbox-item.unread strong, .inbox-item.unread .inbox-snippet { color: var(--text); font-weight: 700; }
.inbox-body { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.inbox-top { display: flex; justify-content: space-between; gap: .5rem; }
.inbox-top time { white-space: nowrap; flex: none; }
.inbox-listing { color: var(--navy-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.inbox-snippet { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- conversation ---------- */
.thread-panel { padding: 0; overflow: hidden; }
.thread-head { display: flex; align-items: center; gap: .8rem; padding: 1rem 1.25rem; border-bottom: 1px solid #eef1f3; }
.thread-head-text { flex: 1; min-width: 0; }
.thread-head h1 { font-size: 1.2rem; margin: 0; }
.thread-cover { width: 64px; height: 48px; object-fit: cover; border-radius: 6px; }
.thread { list-style: none; margin: 0; padding: 1rem 1.25rem; max-height: 60vh; overflow-y: auto; background: #f6f8fa; display: flex; flex-direction: column; gap: .5rem; }
.bubble-row { display: flex; }
.bubble-row.mine { justify-content: flex-end; }
.bubble { max-width: 75%; padding: .6rem .85rem; border-radius: 14px; background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, .08); }
.bubble-row.mine .bubble { background: var(--navy); color: #fff; border-bottom-right-radius: 4px; }
.bubble-row.theirs .bubble { border-bottom-left-radius: 4px; }
.bubble p { margin: 0; white-space: pre-line; overflow-wrap: anywhere; }
.bubble time { display: block; font-size: .72rem; opacity: .7; margin-top: .25rem; text-align: right; }
.reply-form { display: grid; grid-template-columns: 1fr auto; gap: .6rem; align-items: end; padding: 1rem 1.25rem; border-top: 1px solid #eef1f3; }
.reply-form .field-error { grid-column: 1 / -1; margin: 0; }
.reply-form textarea { min-height: 60px; }

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  .listing-layout { grid-template-columns: 1fr; }
  .listing-side { position: static; }
  .filters-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .search-main { grid-template-columns: 1fr; }
  .filters-grid, .field-row { grid-template-columns: 1fr; }
  .field-grid { grid-template-columns: 1fr 1fr; }
  .nav-user { display: none; }
  .row-item { grid-template-columns: 88px 1fr; }
  .row-thumb { width: 88px; height: 66px; }
  .row-actions { grid-column: 1 / -1; flex-direction: row; }
  .row-actions .btn, .row-actions form { flex: 1; }
  .bubble { max-width: 88%; }
  .brand { font-size: 1.2rem; }
  .form-actions { flex-direction: column-reverse; }
  .form-actions .btn { width: 100%; }
}

/* ---------- real-time ---------- */
.bubble-new { animation: bubble-in .25s ease-out; }
@keyframes bubble-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .bubble-new { animation: none; } }

/* ---------- categories / landing ---------- */
.cat-nav { background: var(--navy-2); border-top: 1px solid rgba(255, 255, 255, .08); }
.cat-nav .container { display: flex; gap: .25rem; overflow-x: auto; }
.cat-nav a { display: inline-flex; align-items: center; gap: .45rem; padding: .5rem .85rem; color: rgba(255, 255, 255, .85); text-decoration: none; font-weight: 600; font-size: .92rem; border-bottom: 3px solid transparent; white-space: nowrap; }
.cat-nav a:hover { color: #fff; background: rgba(255, 255, 255, .06); }
.cat-nav a.active { color: #fff; border-bottom-color: var(--red); }
.cat-nav .cat-icon { width: 20px; height: 20px; }
.cat-icon { width: 100%; height: 100%; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }

.breadcrumb { font-size: .88rem; margin-bottom: .75rem; color: rgba(255, 255, 255, .75); }
.breadcrumb a { color: inherit; text-decoration: none; font-weight: 600; }
.breadcrumb a:hover { text-decoration: underline; color: #fff; }
.breadcrumb-dark { color: var(--muted); }
.breadcrumb-dark a { color: var(--navy-2); }
.breadcrumb-dark a:hover { color: var(--navy); }

.landing-hero { padding: 3rem 0 3.5rem; text-align: center; }
.landing-hero > .container > p { max-width: 640px; margin-left: auto; margin-right: auto; }
.landing-search { display: grid; grid-template-columns: 1fr 230px auto; gap: .6rem; max-width: 860px; margin: 1.5rem auto 0; text-align: left; }

.section-title { font-size: 1.4rem; margin-bottom: 1rem; }
.categories { padding-top: 2rem; }
.category-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1rem; }
.category-card { display: flex; align-items: center; gap: 1.1rem; padding: 1.4rem; background: var(--surface); border-radius: 14px; box-shadow: var(--shadow); text-decoration: none; border: 2px solid transparent; transition: transform .15s, box-shadow .15s, border-color .15s; height: 100%; }
.category-card:hover { transform: translateY(-2px); box-shadow: 0 10px 28px rgba(13, 43, 78, .14); border-color: var(--navy-2); }
.category-icon { flex: none; width: 72px; height: 72px; border-radius: 18px; display: grid; place-items: center; padding: 14px; }
.category-property .category-icon { background: #e7f1fb; color: var(--rent); }
.category-car .category-icon { background: #fdecee; color: var(--red); }
.category-body { flex: 1; display: flex; flex-direction: column; gap: .15rem; min-width: 0; }
.category-name { font-size: 1.3rem; font-weight: 800; color: var(--navy); }
.category-text { color: var(--muted); font-size: .92rem; }
.category-count { font-size: .85rem; font-weight: 700; color: var(--navy-2); margin-top: .2rem; }
.category-go { font-size: 1.5rem; color: var(--navy-2); transition: transform .15s; }
.category-card:hover .category-go { transform: translateX(4px); }
.form-page .category-grid { margin-top: 1.25rem; }

.badge-car { background: #5b3cc4; }
.listing-side { top: 124px; }

@media (max-width: 640px) {
  .landing-search { grid-template-columns: 1fr; }
  .landing-hero { padding: 2rem 0 2.5rem; }
  .category-icon { width: 56px; height: 56px; padding: 10px; }
}

/* ---------- feature backlog: shared bits ---------- */
.tag { display: inline-block; vertical-align: middle; margin-left: .35rem; padding: .05rem .5rem; border-radius: 999px; font-size: .72rem; font-weight: 700; background: #eef1f4; color: var(--navy-2); }
.tag-negotiable { background: #fff4d6; color: #7a5200; }
.check { display: flex; align-items: center; gap: .45rem; font-weight: 600; margin-top: .5rem; cursor: pointer; }
.check input { width: auto; margin: 0; }
.stats-line { display: flex; flex-wrap: wrap; gap: .25rem .9rem; }
.stats-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; margin: .5rem 0; }
.stats-grid div { background: #f6f8fa; border-radius: 8px; padding: .5rem .7rem; }
.stats-grid dt { font-size: .78rem; color: var(--muted); font-weight: 600; }
.stats-grid dd { margin: 0; font-size: 1.25rem; font-weight: 800; color: var(--navy); }
.age-refreshed { color: var(--sale); font-weight: 600; }
.row-actions form .btn-outline { width: 100%; }
.card-seller { margin: 0 0 .5rem; }
.card-seller .tag { margin-left: 0; }
.tag-business { background: #e7f1fb; color: var(--rent); }
.seller .tag { margin-left: 0; margin-top: .15rem; }
fieldset.seller-type { border: 0; padding: 0; margin: 0 0 1rem; min-width: 0; }
fieldset.seller-type legend { font-weight: 600; margin-bottom: .3rem; padding: 0; }
.business-kind { margin-top: .6rem; }
.business-kind > label { display: block; font-weight: 600; margin-bottom: .3rem; }

/* ---------- public profile ---------- */
.profile-head { display: flex; gap: 1.1rem; align-items: center; }
.profile-head h1 { font-size: 1.6rem; margin-bottom: .3rem; }
.profile-head .tag { margin-left: 0; }
.avatar-lg { width: 84px; height: 84px; font-size: 2.2rem; }
.profile-info { min-width: 0; flex: 1; }
.profile-facts { list-style: none; padding: 0; margin: .5rem 0 0; display: flex; flex-wrap: wrap; gap: .2rem 1.1rem; }
.tag-quick { background: #e6f6ee; color: #0a5a37; }
.tabs { display: flex; gap: .25rem; flex-wrap: wrap; }
.tabs a { padding: .35rem .8rem; border-radius: 999px; text-decoration: none; font-weight: 600; font-size: .9rem; background: #e7ebef; }
.tabs a.active { background: var(--navy); color: #fff; }
.seller-name { text-decoration: none; }
.seller-name:hover { text-decoration: underline; }
@media (max-width: 640px) { .profile-head { flex-direction: column; align-items: flex-start; } }

/* ---------- reports / moderation ---------- */
.report-box { margin-top: 1rem; border-top: 1px solid #eef1f3; padding-top: .75rem; }
.report-box summary { cursor: pointer; color: var(--muted); font-weight: 600; font-size: .9rem; width: max-content; }
.report-form { margin-top: .6rem; display: grid; gap: .5rem; max-width: 520px; }
.report-form fieldset { border: 0; padding: 0; margin: 0; }
.report-form .check { font-weight: 400; margin-top: .25rem; }
.report-form textarea { min-height: 80px; }
.report-form .btn { justify-self: start; }
.report-item { display: grid; grid-template-columns: 1fr auto; gap: 1rem; align-items: center; }
.report-details { white-space: pre-line; overflow-wrap: anywhere; background: #f6f8fa; border-radius: 8px; padding: .5rem .7rem; }
.tag-report { background: #fdecee; color: var(--red-dark); margin-left: 0; }
.tag-hidden { background: #3d4652; color: #fff; margin-left: 0; }
.hidden-notice { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.admin-hidden-title { margin-top: 2rem; }
@media (max-width: 640px) { .report-item { grid-template-columns: 1fr; } }
.similar { padding-top: .5rem; }

/* ---------- share ---------- */
.title-actions { display: flex; gap: .5rem; align-items: center; }
.share-box { position: relative; }
.share-btn { list-style: none; display: inline-flex; align-items: center; gap: .4rem; cursor: pointer; background: #fff; border: 1px solid var(--border); border-radius: 999px; padding: .35rem .8rem; font-size: .9rem; font-weight: 600; }
.share-btn::-webkit-details-marker { display: none; }
.share-btn:hover { border-color: var(--navy-2); }
.share-btn svg { width: 18px; height: 18px; fill: none; stroke: var(--navy-2); stroke-width: 2; }
.share-menu { position: absolute; right: 0; top: calc(100% + 6px); z-index: 15; background: #fff; border-radius: var(--radius); box-shadow: 0 12px 32px rgba(0, 0, 0, .2); padding: .4rem; width: min(300px, 86vw); display: grid; gap: .1rem; }
.share-menu a { padding: .5rem .7rem; border-radius: 6px; text-decoration: none; font-weight: 600; }
.share-menu a:hover { background: #f1f4f7; }
.share-copy { display: flex; gap: .4rem; padding: .4rem .3rem .2rem; border-top: 1px solid #eef1f3; margin-top: .2rem; }
.share-copy input { font-size: .85rem; padding: .35rem .5rem; }

/* ---------- saved searches / notifications ---------- */
.results-actions { display: flex; align-items: center; gap: .8rem; flex-wrap: wrap; }
.save-search { position: relative; }
.save-search summary { list-style: none; }
.save-search summary::-webkit-details-marker { display: none; }
.save-search-form { position: absolute; right: 0; top: calc(100% + 6px); z-index: 15; width: min(320px, 88vw); background: #fff; border-radius: var(--radius); box-shadow: 0 12px 32px rgba(0, 0, 0, .2); padding: 1rem; display: grid; gap: .4rem; }
.save-search-form label { font-weight: 600; }
.save-search-form .btn { justify-self: start; margin-top: .3rem; }
.saved-search-head { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.saved-search-head .row-title { margin: 0; }
.filter-chips { display: flex; flex-wrap: wrap; gap: .35rem; margin: .5rem 0; }
.saved-search-actions { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.saved-search-actions form { margin: 0; }
.rename-form { display: flex; gap: .4rem; flex: 1; min-width: 220px; }
.rename-form input { padding: .35rem .6rem; }
@media (max-width: 640px) { .save-search-form { right: auto; left: 0; } }

/* ---------- extra ad fields ---------- */
.check-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: .2rem 1rem; margin-top: .25rem; }
.check-grid .check { font-weight: 500; margin-top: .35rem; }
.must-have { grid-column: 1 / -1; border: 0; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: .2rem 1.1rem; }
.must-have legend { font-size: .85rem; font-weight: 600; color: var(--muted); padding: 0; margin-bottom: .1rem; width: 100%; }
.must-have .check { font-weight: 500; margin-top: .2rem; }
.equipment-groups { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: .25rem 1.25rem; }
.equipment-groups .subhead { margin-top: .5rem; }
.equipment-list { list-style: none; padding: 0; margin: 0; }
.equipment-list li { padding: .15rem 0 .15rem 1.4rem; position: relative; }
.equipment-list li::before { content: "✓"; position: absolute; left: 0; color: var(--sale); font-weight: 800; }
.price-eval-below { background: #e6f6ee; color: #0a5a37; }
.price-eval-average { background: #e8f0fb; color: #173f7a; }
.price-eval-above { background: #fdf0e1; color: #8a4b00; }
.price-eval-box { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; margin: -.2rem 0 .6rem; }
.price-eval-box .tag { margin-left: 0; }

/* ---------- loan / mortgage calculator ---------- */
.calc-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0 1rem; }
.calc-presets { display: flex; flex-wrap: wrap; gap: .3rem; margin-top: .4rem; }
.calc-result { display: grid; grid-template-columns: repeat(4, 1fr); gap: .5rem; margin: .25rem 0 .5rem; }
.calc-result div { background: #f6f8fa; border-radius: 8px; padding: .5rem .7rem; }
.calc-result dt { font-size: .78rem; color: var(--muted); font-weight: 600; }
.calc-result dd { margin: 0; font-weight: 800; }
.calc-result .calc-monthly { background: #e8f0fb; }
.calc-result .calc-monthly dd { font-size: 1.3rem; color: var(--navy); }
@media (max-width: 900px) { .calc-grid, .calc-result { grid-template-columns: 1fr 1fr; } }
.vin-reveal dd { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.vin-field input { text-transform: uppercase; }

/* ---------- cards: stretched title link (so make/model links can live inside the card) ---------- */
.card { position: relative; }
.card-link { text-decoration: none; color: inherit; }
.card-link::after { content: ""; position: absolute; inset: 0; z-index: 1; }
.card-link:focus-visible { outline: none; }
.card:focus-within { outline: 3px solid #4d9fff; outline-offset: 2px; }
.card-sublink { position: relative; z-index: 2; color: var(--navy-2); font-weight: 600; text-decoration: none; }
.card-sublink:hover { text-decoration: underline; }
.fav-card { z-index: 3; }
.chip-link { text-decoration: none; color: var(--navy-2); }
.chip-link:hover { background: #dde3e9; }
.per-sqm { font-weight: 600; color: var(--navy-2); }

/* ---------- map view of results ---------- */
.view-toggle { display: inline-flex; border: 1px solid var(--border); border-radius: 999px; overflow: hidden; background: #fff; }
.view-toggle a { padding: .3rem .8rem; text-decoration: none; font-weight: 600; font-size: .9rem; }
.view-toggle a.active { background: var(--navy); color: #fff; }
.results-map { height: min(70vh, 620px); }
.map-cluster { display: grid; place-items: center; }
.map-cluster span { display: grid; place-items: center; width: 100%; height: 100%; border-radius: 50%; background: var(--red); color: #fff; font-weight: 800; font-size: .85rem; border: 3px solid rgba(255, 255, 255, .85); box-shadow: 0 2px 6px rgba(0, 0, 0, .35); cursor: pointer; }
.map-card { display: flex; gap: .6rem; text-decoration: none; color: var(--text); padding: .2rem 0; }
.map-card img { width: 84px; height: 64px; object-fit: cover; border-radius: 6px; flex: none; }
.map-card-body { display: flex; flex-direction: column; min-width: 0; }
.map-card-price { font-weight: 800; color: var(--navy); }
.map-card-title { font-weight: 600; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.map-card-meta { color: var(--muted); font-size: .8rem; margin: 0; }
.map-list { display: grid; gap: .4rem; }
.map-list .map-card + .map-card { border-top: 1px solid #eef1f3; padding-top: .4rem; }
.tag-reduced { background: #e6f6ee; color: #0a5a37; }
.tag-raised { background: #fdecee; color: var(--red-dark); }
.price-reduced { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; margin: -.2rem 0 .6rem; }
.price-reduced .tag { margin-left: 0; }
.price-history { list-style: none; padding: 0; margin: 0; }
.price-history li { display: flex; flex-wrap: wrap; align-items: center; gap: .3rem .9rem; padding: .45rem 0; border-bottom: 1px solid #eef1f3; }
.price-history li:last-child { border-bottom: 0; }
.price-history time { color: var(--muted); font-size: .9rem; min-width: 9rem; }

/* ---------- price statistics ---------- */
.hero-link { color: #fff; font-weight: 700; }
.prices-filter { display: flex; flex-wrap: wrap; gap: .75rem; align-items: center; }
.prices-filter .segmented { min-width: 240px; }
.prices-filter label { flex: 1; min-width: 200px; }
.prices-overall { font-size: 1.05rem; }
.table-wrap { overflow-x: auto; }
.stats-table { width: 100%; border-collapse: collapse; }
.stats-table th, .stats-table td { text-align: left; padding: .5rem .6rem; border-bottom: 1px solid #eef1f3; white-space: nowrap; }
.stats-table thead th { font-size: .82rem; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; }
.stats-table td { font-variant-numeric: tabular-nums; }
.stats-table tr:target { background: #fff8e1; }
.compare-link { display: block; font-weight: 600; margin-top: .2rem; }

/* ---------- projects ---------- */
.badge-project { position: absolute; top: .6rem; left: .6rem; }
.listing-main .badge-project { position: static; }
.badge-off_plan { background: #7a5200; }
.badge-under_construction { background: #c25e00; }
.badge-ready { background: var(--sale); }
.project-actions { display: flex; gap: .5rem; margin-top: .5rem; }
.project-actions form { margin: 0; }

/* ---------- business profile ---------- */
.logo { width: 48px; height: 48px; border-radius: 10px; object-fit: contain; background: #fff; border: 1px solid var(--border); flex: none; }
.logo-lg { width: 96px; height: 96px; border-radius: 14px; }
.logo-preview { width: 80px; height: 80px; object-fit: contain; border: 1px solid var(--border); border-radius: 10px; margin: .3rem 0; background: #fff; }
.business-logo input[type="file"] { margin-top: .4rem; }
.storefront .specs { margin-top: .5rem; }
.storefront .hours { grid-column: 1 / -1; }
.seller .seller-name + .muted { display: block; }

/* ---------- directory ---------- */
.directory-item { display: grid; grid-template-columns: 64px 1fr auto; gap: 1rem; align-items: center; }
.logo-md { width: 64px; height: 64px; }
.directory-item .avatar { width: 64px; height: 64px; }
.directory-counts { display: flex; flex-wrap: wrap; gap: .2rem 1rem; }
.footer-links { display: flex; flex-wrap: wrap; gap: .4rem 1.1rem; }
.footer-links a { color: rgba(255, 255, 255, .85); text-decoration: none; font-size: .92rem; }
.footer-links a:hover { text-decoration: underline; color: #fff; }
@media (max-width: 640px) { .directory-item { grid-template-columns: 48px 1fr; } .directory-item .btn { grid-column: 1 / -1; } .logo-md, .directory-item .avatar { width: 48px; height: 48px; } }

/* ---------- ratings ---------- */
.stars { color: #e0a100; letter-spacing: .05em; white-space: nowrap; }
.stars-off { color: #cfd6dd; }
.stars-text { font-size: .9rem; }
.rating-link { text-decoration: none; display: inline-block; }
.rating-link:hover .stars-text { text-decoration: underline; }
.seller .rating-link { display: block; }
.rating-box { padding: .6rem 1.25rem; border-bottom: 1px solid #eef1f3; background: #fffdf5; }
.rating-box summary { cursor: pointer; width: max-content; }
.rating-box p { margin: 0; }
.rating-form { display: grid; gap: .5rem; max-width: 480px; margin-top: .6rem; }
.rating-form textarea { min-height: 70px; }
.rating-form .btn { justify-self: start; }
.star-input { border: 0; padding: 0; margin: 0; display: inline-flex; flex-direction: row-reverse; justify-content: flex-end; gap: .1rem; }
.star-input legend { float: left; width: 100%; font-weight: 600; margin-bottom: .2rem; padding: 0; }
.star-input input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.star-input label { font-size: 1.8rem; color: #cfd6dd; cursor: pointer; line-height: 1; }
.star-input input:checked ~ label, .star-input label:hover, .star-input label:hover ~ label { color: #e0a100; }
.star-input input:focus-visible + label { outline: 3px solid #4d9fff; outline-offset: 2px; border-radius: 4px; }
.review-list { list-style: none; padding: 0; margin: .75rem 0 0; }
.review-list li { padding: .75rem 0; border-top: 1px solid #eef1f3; }
.review-head { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin-bottom: .3rem; }
.review-reply { margin: .4rem 0 0 1rem; padding: .5rem .75rem; background: #f6f8fa; border-left: 3px solid var(--navy-2); border-radius: 6px; }
.review-reply p { margin: 0; }
.reply-review-form { display: grid; grid-template-columns: 1fr auto; gap: .5rem; align-items: end; margin-top: .4rem; }
.reply-review-form textarea { min-height: 50px; }

/* ---------- safety tips / fraud warnings ---------- */
.safety-tips { background: #fff8e1; border: 1px solid #f0d98a; border-radius: var(--radius); padding: .75rem 1rem; margin-bottom: 1rem; }
.safety-tips summary { cursor: pointer; font-weight: 700; color: #6b4b00; }
.safety-tips ul { margin: .5rem 0; padding-left: 1.2rem; }
.safety-tips li { margin: .2rem 0; }
.safety-tips p { margin: 0; color: #6b4b00; }
.chat-safety { padding: .6rem 1.25rem 0; }
.chat-safety .safety-tips { margin-bottom: 0; }
.bubble-row { flex-wrap: wrap; }
.msg-warning { flex-basis: 100%; margin: .25rem 0 0; font-size: .82rem; font-weight: 600; color: #8a4b00; background: #fff4d6; border-radius: 8px; padding: .35rem .6rem; max-width: 75%; }
.bubble-row.mine .msg-warning { margin-left: auto; }
.hp-field { position: absolute; left: -10000px; top: auto; width: 1px; height: 1px; overflow: hidden; }
.cf-turnstile { margin: .75rem 0; }
.h3 { font-size: 1.1rem; margin: 1.25rem 0 .35rem; }
.reset-by-email { border-bottom: 1px solid var(--border, #e5e7eb); padding-bottom: 1rem; margin-bottom: .5rem; }
.btn-danger { background: var(--red); color: #fff; border-color: var(--red); }
.btn-danger:hover { background: var(--red-dark); border-color: var(--red-dark); }
.panel-danger { border-color: #f1b8bf; }
.check-terms { font-weight: 500; align-items: flex-start; }
.check-terms input { margin-top: .25rem; }
.legal-page h2 { font-size: 1.15rem; margin-top: 1.5rem; }
.legal-page .lead { font-size: 1.05rem; }
.legal-page ul { padding-left: 1.2rem; }
.tag-status { background: #1f2937; color: #fff; }
.tag-status-reserved { background: #b45309; }
.tag-expired { background: #6b7280; color: #fff; }
.lifecycle { display: grid; gap: .4rem; }
.lifecycle-line { margin: 0; }
.status-form label { display: block; }
.status-row { display: flex; gap: .4rem; }
.status-row select { flex: 1; min-width: 0; }
