/* ==========================================================================
   Palettes. The design-options panel switches data-palette on <html>.
   Each palette defines the same set of variables; nothing else in this file
   uses raw colors except a few overlays on top of photos.
   ========================================================================== */

/* Muted palettes */
:root,
[data-palette="clay"] {
  --bg: #F7F5F2;
  --surface: #FFFFFF;
  --surface-2: #EFEBE6;
  --text: #2B2724;
  --text-muted: #746D67;
  --border: #E3DED8;
  --accent: #9C5B43;
  --accent-hover: #844A35;
  --accent-soft: #F1E6E0;
  --brand: #9C5B43;
  --brand-ink: #2B2724;
  --on-accent: #FFFFFF;
}

[data-palette="slate"] {
  --bg: #F5F6F7;
  --surface: #FFFFFF;
  --surface-2: #ECEEF0;
  --text: #1F2428;
  --text-muted: #687079;
  --border: #DFE3E6;
  --accent: #44596B;
  --accent-hover: #364858;
  --accent-soft: #E3E8ED;
  --brand: #44596B;
  --brand-ink: #1F2428;
  --on-accent: #FFFFFF;
}

[data-palette="moss"] {
  --bg: #F6F6F2;
  --surface: #FFFFFF;
  --surface-2: #EDEDE6;
  --text: #24261F;
  --text-muted: #6C6E64;
  --border: #E1E1D8;
  --accent: #5E6B4E;
  --accent-hover: #4C573F;
  --accent-soft: #E6EADF;
  --brand: #5E6B4E;
  --brand-ink: #24261F;
  --on-accent: #FFFFFF;
}

[data-palette="stone"] {
  --bg: #F6F4F1;
  --surface: #FFFFFF;
  --surface-2: #ECE8E3;
  --text: #262320;
  --text-muted: #726B64;
  --border: #E2DDD6;
  --accent: #4A4540;
  --accent-hover: #36322E;
  --accent-soft: #E9E5E0;
  --brand: #4A4540;
  --brand-ink: #262320;
  --on-accent: #FFFFFF;
}

/* Brighter palettes */
[data-palette="terracotta"] {
  --bg: #FBF8F4;
  --surface: #FFFFFF;
  --surface-2: #F3EEE7;
  --text: #2A2420;
  --text-muted: #776D65;
  --border: #E7DFD5;
  --accent: #C2532C;
  --accent-hover: #A6431F;
  --accent-soft: #F8E7DF;
  --brand: #C2532C;
  --brand-ink: #2A2420;
  --on-accent: #FFFFFF;
}

[data-palette="andean"] {
  --bg: #F7F9F7;
  --surface: #FFFFFF;
  --surface-2: #EDF2EE;
  --text: #1D2621;
  --text-muted: #63716A;
  --border: #DCE4DE;
  --accent: #2F6B4F;
  --accent-hover: #245840;
  --accent-soft: #E1EEE6;
  --brand: #2F6B4F;
  --brand-ink: #1D2621;
  --on-accent: #FFFFFF;
}

[data-palette="lake"] {
  --bg: #F7F8FB;
  --surface: #FFFFFF;
  --surface-2: #EDF0F6;
  --text: #1B2233;
  --text-muted: #646E86;
  --border: #DDE2ED;
  --accent: #2B4C8C;
  --accent-hover: #213C72;
  --accent-soft: #E3E9F6;
  --brand: #2B4C8C;
  --brand-ink: #1B2233;
  --on-accent: #FFFFFF;
}

[data-palette="mono"] {
  --bg: #FAFAFA;
  --surface: #FFFFFF;
  --surface-2: #F0F0F0;
  --text: #161616;
  --text-muted: #6B6B6B;
  --border: #E3E3E3;
  --accent: #161616;
  --accent-hover: #000000;
  --accent-soft: #ECECEC;
  --brand: #161616;
  --brand-ink: #161616;
  --on-accent: #FFFFFF;
}

/* Headings in Source Serif 4, body in Inter (loaded from Google Fonts in each page's <head>). */
:root {
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-heading: "Source Serif 4", Georgia, "Times New Roman", serif;
  --heading-weight: 600;
  --heading-tracking: -0.005em;
  --radius: 8px;
  --radius-sm: 6px;
  --header-h: 64px;
  --toolbar-h: 64px;
  --sticky-top: calc(var(--header-h) + var(--toolbar-h));
  --detail-w: 500px;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .06);
  --shadow: 0 4px 16px rgba(0, 0, 0, .08);
  --shadow-lg: 0 12px 36px rgba(0, 0, 0, .16);
  --whatsapp: #25D366;
  --whatsapp-hover: #1DB954;
}


/* Dark mode (header toggle). Works with every palette: the surfaces get a faint
   tint of the palette's color, and the accent is lightened so it stays readable
   on dark backgrounds. --brand/--brand-ink keep the light-mode values. */
:root[data-mode="dark"] {
  color-scheme: dark;
  --bg: color-mix(in srgb, var(--brand) 6%, #121110);
  --surface: color-mix(in srgb, var(--brand) 7%, #1B1A18);
  --surface-2: color-mix(in srgb, var(--brand) 9%, #262421);
  --text: #ECE8E3;
  --text-muted: #A8A19A;
  --border: color-mix(in srgb, var(--brand) 10%, #35322E);
  --accent: color-mix(in srgb, var(--brand) 58%, #FFFFFF);
  --accent-hover: color-mix(in srgb, var(--brand) 45%, #FFFFFF);
  --accent-soft: color-mix(in srgb, var(--brand) 26%, #1B1A18);
  --on-accent: #161412;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
  --shadow: 0 4px 16px rgba(0, 0, 0, .45);
  --shadow-lg: 0 12px 36px rgba(0, 0, 0, .6);
}
:root[data-mode="dark"][data-palette="mono"] {
  --accent: #EDEDED;
  --accent-hover: #FFFFFF;
  --accent-soft: #2C2C2C;
}

/* ==========================================================================
   Base
   ========================================================================== */

*, *::before, *::after { box-sizing: border-box; }

html, body { margin: 0; }
/* `hidden` always hides, even where a class sets display (the unread count in the menu showed as an empty pill) */
[hidden] { display: none !important; }

body {
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; }

/* Headings, prices and the logo name use the heading font. */
h1, h2, h3, h4,
.card-price, .detail-price, .service-price strong {
  font-family: var(--font-heading);
  font-weight: var(--heading-weight);
  letter-spacing: var(--heading-tracking);
  font-variant-numeric: lining-nums;
}
h1, h2, h3, h4 { line-height: 1.2; }

a { color: inherit; }

button { font: inherit; color: inherit; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.icon { flex: none; display: block; }

/* ==========================================================================
   Buttons and form controls
   ========================================================================== */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 40px; padding: 0 14px;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--text);
  font-size: 14px; font-weight: 500; line-height: 1;
  text-decoration: none; white-space: nowrap; cursor: pointer;
  transition: background-color .15s, border-color .15s, color .15s;
}
.btn:hover { background: var(--surface-2); }

.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }

.btn-ghost { background: transparent; border-color: transparent; }
.btn-ghost:hover { background: var(--surface-2); }

.btn-whatsapp { background: var(--whatsapp); border-color: var(--whatsapp); color: #fff; }
.btn-whatsapp:hover { background: var(--whatsapp-hover); border-color: var(--whatsapp-hover); }

.btn-lg { height: 48px; padding: 0 20px; font-size: 15px; font-weight: 600; }
.btn-block { width: 100%; }

.btn.is-saved .icon { fill: var(--accent); stroke: var(--accent); }

.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; padding: 0;
  border: 0; border-radius: 50%; background: transparent; cursor: pointer;
  color: var(--text-muted);
}
.icon-btn:hover { background: var(--surface-2); color: var(--text); }

.link-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 0; border: 0; background: none; cursor: pointer;
  color: var(--text-muted); font-size: 14px; text-decoration: underline; text-underline-offset: 3px;
}
.link-btn:hover { color: var(--text); }

.count-badge {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px;
  background: var(--accent); color: var(--on-accent); font-size: 12px; font-weight: 600;
}
.count-badge[hidden] { display: none; }

.input {
  width: 100%; height: 42px; padding: 0 12px;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--text); font: inherit; font-size: 15px;
}
.input:focus { outline: 2px solid var(--accent); outline-offset: -1px; border-color: transparent; }
.input::placeholder { color: var(--text-muted); opacity: .8; }

.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field label { font-size: 13px; font-weight: 600; }

.select { position: relative; display: inline-flex; align-items: center; }
.select select {
  appearance: none; -webkit-appearance: none;
  height: 40px; padding: 0 36px 0 14px;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--text);
  font: inherit; font-size: 14px; font-weight: 500; cursor: pointer;
}
.select select:hover { background: var(--surface-2); }
.select > [data-icon] { position: absolute; right: 12px; pointer-events: none; color: var(--text-muted); }

.check { display: flex; align-items: center; gap: 10px; font-size: 14px; cursor: pointer; }
.check input { width: 16px; height: 16px; margin: 0; accent-color: var(--accent); }

.pills { display: flex; flex-wrap: wrap; gap: 6px; }
.contact-phone { margin: 10px 0 0 26px; }
.contact-phone .field-label { display: block; margin-bottom: 4px; }
.contact-phone .input { max-width: 260px; }
.contact-phone .hint { margin: 6px 0 0; }
.contact-phone a { color: inherit; }
.pill {
  padding: 6px 14px; border: 1px solid var(--border); border-radius: 999px;
  background: var(--surface); font-size: 13px; font-weight: 500; cursor: pointer;
}
.pill:hover { border-color: var(--text-muted); }
.pill[aria-pressed="true"] { background: var(--text); border-color: var(--text); color: var(--surface); }

.hint { margin: 6px 0 0; font-size: 13px; color: var(--text-muted); }

/* ==========================================================================
   Header
   ========================================================================== */

.site-header {
  position: sticky; top: 0; z-index: 1000;
  display: flex; align-items: center; gap: 12px;
  height: var(--header-h); padding: 0 24px;
  background: var(--surface); border-bottom: 1px solid var(--border);
}

.logo { display: flex; align-items: center; gap: 9px; text-decoration: none; color: var(--text); }
.logo-mark { display: block; flex: none; }
.logo-text {
  font-family: var(--font-heading); font-weight: var(--heading-weight);
  font-size: 21px; line-height: 1; letter-spacing: var(--heading-tracking);
}
.logo-wordmark { font-size: 25px; }
.logo-x { color: var(--accent); }

.header-prefs { display: flex; align-items: center; gap: 4px; margin-right: 4px; }

.header-tagline {
  padding-left: 14px; border-left: 1px solid var(--border);
  font-size: 14px; color: var(--text-muted); white-space: nowrap;
}
.header-spacer { flex: 1; }
.header-nav { display: flex; align-items: center; gap: 8px; }

.nav-link {
  padding: 8px 12px; border-radius: var(--radius-sm);
  font-size: 14px; font-weight: 500; text-decoration: none; color: var(--text);
}
.nav-link:hover { background: var(--surface-2); }
.nav-link[aria-current="page"] { color: var(--accent); }

.segmented {
  display: inline-flex; padding: 3px; gap: 2px;
  background: var(--surface-2); border-radius: calc(var(--radius-sm) + 3px);
}
.segmented button {
  display: flex; align-items: center; gap: 6px;
  height: 34px; padding: 0 14px;
  border: 0; border-radius: var(--radius-sm); background: transparent;
  font-size: 14px; font-weight: 500; color: var(--text-muted); cursor: pointer;
}
.segmented button:hover { color: var(--text); }
.segmented button[aria-pressed="true"] { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }

.filters-control { position: relative; }

.popover {
  position: absolute; top: calc(100% + 8px); left: 0; z-index: 1100;
  width: 360px; padding: 20px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
}
.popover[hidden] { display: none; }

.filter-group { margin-bottom: 18px; }
.filter-label { margin-bottom: 8px; font-size: 13px; font-weight: 600; }
.filter-group.checks { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.filter-group.unknown { padding-top: 14px; border-top: 1px solid var(--border); }

.price-range { display: flex; align-items: center; gap: 8px; }
.range-dash { color: var(--text-muted); }
.input-prefix { position: relative; flex: 1; }
.input-prefix span {
  position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
  font-size: 14px; color: var(--text-muted); pointer-events: none;
}
.input-prefix .input { padding-left: 34px; }
.input-prefix .input::-webkit-inner-spin-button { display: none; }

.filter-advanced { margin-bottom: 18px; border-top: 1px solid var(--border); padding-top: 14px; }
.filter-advanced summary {
  display: flex; align-items: center; justify-content: space-between;
  list-style: none; cursor: pointer; font-size: 14px; font-weight: 600;
}
.filter-advanced summary::-webkit-details-marker { display: none; }
.filter-advanced summary .icon { color: var(--text-muted); transition: transform .15s; }
.filter-advanced[open] summary { margin-bottom: 14px; }
.filter-advanced[open] summary .icon { transform: rotate(180deg); }

.popover-foot {
  display: flex; align-items: center; justify-content: space-between;
  padding-top: 14px; border-top: 1px solid var(--border);
}

/* Account menu */
.menu-wrap { position: relative; }
.avatar {
  display: flex; align-items: center; justify-content: center;
  width: 38px; height: 38px; border-radius: 50%;
  border: 0; background: var(--accent-soft); color: var(--accent-hover);
  font-weight: 700; cursor: pointer;
}
.menu {
  position: absolute; right: 0; top: calc(100% + 8px); z-index: 1100;
  min-width: 220px; padding: 6px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
}
.menu[hidden] { display: none; }
.menu-head { padding: 8px 10px; font-size: 13px; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; }
.menu button, .menu a {
  display: block; width: 100%; padding: 9px 10px; border: 0; border-radius: var(--radius-sm);
  background: none; text-align: left; font-size: 14px; color: var(--text); text-decoration: none; cursor: pointer;
}
.menu button:hover, .menu a:hover { background: var(--surface-2); }
.menu hr { margin: 6px 0; border: 0; border-top: 1px solid var(--border); }

/* ==========================================================================
   Browse page layout
   ========================================================================== */

/* The page scrolls normally, while the toolbar, the map and the detail panel
   stick below the header. */

.browse { display: flex; align-items: flex-start; }

/* The footer stays at the bottom of the screen when there are few listings: the page is at least the screen's
   height, the browse area takes what the header and toolbar leave, and the list pane (a column) pushes the
   footer to its end. With many listings it simply follows them. */
.page-browse { display: flex; flex-direction: column; min-height: 100vh; min-height: 100dvh; }
.page-browse .browse { flex: 1 0 auto; }

.list-pane { flex: 1; min-width: 0; padding: 24px 28px 32px; align-self: stretch; display: flex; flex-direction: column; }

.map-pane,
.detail-pane {
  position: sticky; top: var(--sticky-top);
  height: calc(100vh - var(--sticky-top));
}
.map-pane { flex: 1; min-width: 0; isolation: isolate; }
#map { position: absolute; inset: 0; background: var(--surface-2); }

.detail-pane {
  flex: none; width: var(--detail-w); overflow-y: auto;
  background: var(--surface); border-left: 1px solid var(--border);
}

[data-view="listings"][data-detail="closed"] .detail-pane,
[data-view="listings"] .map-pane,
[data-view="map"] .list-pane,
[data-view="map"] .sort-control { display: none; }

@media (max-width: 1400px) { :root { --detail-w: 440px; } }
@media (max-width: 1180px) { :root { --detail-w: 380px; } }

/* ==========================================================================
   Toolbar (view, filters, sort) — sticks under the header
   ========================================================================== */

.toolbar {
  position: sticky; top: var(--header-h); z-index: 900;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  height: var(--toolbar-h); padding: 0 28px;
  background: var(--surface); border-bottom: 1px solid var(--border);
}
.toolbar-controls { display: flex; align-items: center; gap: 10px; }

/* ==========================================================================
   Listing grid and cards
   ========================================================================== */

.list-count { margin: 0; font-size: 14px; color: var(--text-muted); }
.list-count strong { color: var(--text); font-weight: 600; }
.new-count { color: var(--text); font-weight: 500; }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 28px 20px;
}

.card {
  scroll-margin-top: calc(var(--sticky-top) + 16px);
  border-radius: var(--radius); cursor: pointer;
  outline: 2px solid transparent; outline-offset: 6px;
  transition: outline-color .15s;
}
.card:hover .card-media img { transform: scale(1.02); }
.card.is-selected { outline-color: var(--accent); }
.card:focus-visible { outline-color: var(--accent); }

.card-media {
  position: relative; aspect-ratio: 4 / 3; overflow: hidden;
  border-radius: var(--radius); background: var(--surface-2);
}
.card-media img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform .3s; }

.card-badges { position: absolute; top: 10px; left: 10px; display: flex; gap: 6px; }

.chip-overlay {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 9px; border-radius: 999px;
  background: rgba(255, 255, 255, .95); color: #222;
  font-size: 12px; font-weight: 600; box-shadow: var(--shadow-sm);
}
.chip-overlay .icon { color: var(--accent); }
.chip-overlay.is-new { background: var(--text); color: var(--surface); }

.save-btn {
  position: absolute; top: 8px; right: 8px;
  display: flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border: 0; border-radius: 50%;
  background: rgba(255, 255, 255, .92); color: #222; cursor: pointer;
  box-shadow: var(--shadow-sm); transition: transform .15s;
}
.save-btn:hover { transform: scale(1.08); }
.save-btn.is-saved .icon { fill: var(--accent); stroke: var(--accent); }

.carousel-btn {
  position: absolute; top: 50%; transform: translateY(-50%);
  display: flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; border: 0; border-radius: 50%;
  background: rgba(255, 255, 255, .92); color: #222; cursor: pointer;
  box-shadow: var(--shadow-sm); opacity: 0; transition: opacity .15s;
}
.carousel-btn.prev { left: 8px; }
.carousel-btn.next { right: 8px; }
.carousel-btn[hidden] { display: none; }
.card-media:hover .carousel-btn,
.card:focus-within .carousel-btn,
.gallery .carousel-btn { opacity: 1; }

.carousel-count {
  position: absolute; bottom: 10px; right: 10px;
  padding: 2px 8px; border-radius: 999px;
  background: rgba(0, 0, 0, .55); color: #fff; font-size: 12px; font-weight: 500;
}

.card-body { padding: 10px 2px 0; }
.card-row { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.card-price { font-size: 18px; }
.card-price span {
  margin-left: 2px; font-family: var(--font-body); font-size: 14px; font-weight: 400;
  letter-spacing: 0; color: var(--text-muted);
}
.card-date { font-size: 13px; color: var(--text-muted); white-space: nowrap; }
.card-street { margin-top: 2px; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-meta { font-size: 13px; color: var(--text-muted); }

.seen-divider {
  grid-column: 1 / -1;
  display: flex; align-items: center; gap: 14px;
  font-size: 13px; font-weight: 500; color: var(--text-muted);
}
.seen-divider::before,
.seen-divider::after { content: ""; flex: 1; height: 1px; background: var(--border); }

.list-empty { grid-column: 1 / -1; padding: 60px 0; text-align: center; color: var(--text-muted); }
.list-empty p { margin: 0 0 8px; }

.list-foot { margin-top: auto; padding-top: 48px; font-size: 13px; color: var(--text-muted); text-align: center; }
.list-foot a { color: inherit; }
.legal { max-width: 760px; line-height: 1.6; }
.about { max-width: 760px; line-height: 1.6; }
.about h1 { margin: 20px 0 16px; font-size: clamp(28px, 4vw, 38px); line-height: 1.15; }
.about h2 { margin: 36px 0 8px; font-size: 24px; }
.faq { margin-top: 48px; padding-top: 12px; border-top: 1px solid var(--border); }
.faq h3 { margin: 28px 0 6px; font-family: var(--font-body); font-size: 17px; font-weight: 600; }
.faq p { margin: 0; color: var(--text-muted); }
.faq a { color: var(--accent); }
.about-photo { display: block; width: 100%; height: auto; margin-top: 28px; border-radius: var(--radius); }
.about-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }
.legal h2 { margin: 28px 0 8px; font-size: 20px; }
.legal li { margin: 4px 0; }
.legal-draft { padding: 10px 14px; border-radius: var(--radius-sm); background: var(--accent-soft); font-size: 14px; }

/* ==========================================================================
   Detail panel
   ========================================================================== */

.detail-empty {
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  height: 100%; padding: min(26vh, 220px) 24px 24px; text-align: center; color: var(--text-muted);
}
.detail-empty p { margin: 0; font-size: 15px; }

.gallery { position: relative; aspect-ratio: 3 / 2; background: #111; }
.gallery-stage, .gallery-stage img, .gallery-stage video { display: block; width: 100%; height: 100%; }
.gallery-stage img, .gallery-stage video { object-fit: cover; }
.gallery-stage video { object-fit: contain; background: #000; }

.media-label {
  position: absolute; top: 12px; left: 12px;
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 9px; border-radius: 999px;
  background: rgba(0, 0, 0, .6); color: #fff; font-size: 12px; font-weight: 500;
  pointer-events: none;
}

.detail-close {
  position: absolute; top: 12px; right: 12px;
  display: flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border: 0; border-radius: 50%;
  background: rgba(255, 255, 255, .92); color: #222; cursor: pointer; box-shadow: var(--shadow-sm);
}

.thumbs { display: flex; gap: 6px; padding: 10px 20px 0; overflow-x: auto; scrollbar-width: thin; }
.thumb {
  position: relative; flex: none; width: 64px; height: 48px; padding: 0;
  border: 2px solid transparent; border-radius: calc(var(--radius-sm) - 2px);
  overflow: hidden; background: var(--surface-2); cursor: pointer; opacity: .75;
}
.thumb:hover { opacity: 1; }
.thumb.is-active { border-color: var(--accent); opacity: 1; }
.thumb img { display: block; width: 100%; height: 100%; object-fit: cover; }
.thumb-play {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  background: rgba(0, 0, 0, .35); color: #fff;
}

.detail-body { padding: 18px 24px 28px; }

.detail-price { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 8px; font-size: 30px; }
.detail-price .per {
  margin-left: -4px; font-family: var(--font-body); font-size: 16px; font-weight: 400;
  letter-spacing: 0; color: var(--text-muted);
}
.detail-price .tag { font-family: var(--font-body); }
.detail-deposit { font-size: 14px; color: var(--text-muted); }

.tag {
  align-self: center;
  padding: 2px 9px; border-radius: 999px;
  background: var(--accent-soft); color: var(--accent-hover);
  font-size: 12px; font-weight: 600; letter-spacing: 0;
}

.detail-location { display: flex; align-items: center; gap: 6px; margin-top: 14px; font-weight: 500; }
.detail-location .icon { color: var(--text-muted); }
.detail-posted { margin-top: 2px; font-size: 13px; color: var(--text-muted); }

.verified-line {
  display: inline-flex; align-items: center; gap: 6px; margin-top: 10px;
  font-size: 13px; font-weight: 600; color: var(--accent);
}

.contact-slot { margin-top: 18px; }
.contact-box { padding: 16px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg); }
.contact-label { font-size: 13px; color: var(--text-muted); }
.contact-number { margin: 2px 0 12px; font-size: 22px; font-weight: 700; letter-spacing: .02em; }
.contact-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.contact-box .hint { margin-top: 10px; }

.detail-actions { display: flex; gap: 8px; margin-top: 10px; }
.detail-actions > * { flex: 1; }
.detail-actions .btn { width: 100%; }

.section { margin-top: 28px; }
.section h3 { margin: 0 0 10px; font-size: 16px; font-weight: 600; }
.description { margin: 0; white-space: pre-line; }

.facts { display: flex; flex-wrap: wrap; gap: 8px; }
.fact {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 7px 12px; border: 1px solid var(--border); border-radius: 999px; font-size: 14px;
}
.fact .icon { color: var(--text-muted); }
.fact.is-off { color: var(--text-muted); }

.verified-box { padding: 18px; border-radius: var(--radius); background: var(--accent-soft); }
.verified-title { display: flex; align-items: center; gap: 8px; color: var(--accent-hover); }
.verified-title strong { font-size: 16px; color: var(--text); }
.verified-meta { margin: 4px 0 12px; font-size: 13px; color: var(--text-muted); }
.verified-box .btn { margin-top: 14px; }

.mini-map {
  height: 190px; border-radius: var(--radius); overflow: hidden;
  border: 1px solid var(--border); isolation: isolate; background: var(--surface-2);
}
.mini-map { position: relative; }
.mini-map .leaflet-control-attribution { font-size: 10px; }

/* Shown instead of the map when the page is opened straight from disk. */
.map-notice {
  position: absolute; inset: 0; z-index: 1000;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
  padding: 24px; text-align: center; color: var(--text-muted); background: var(--surface-2);
}
.map-notice p { max-width: 360px; margin: 0; font-size: 14px; }
.map-notice a { color: var(--accent); font-weight: 600; }
.map-notice code {
  padding: 6px 10px; border-radius: var(--radius-sm);
  background: var(--surface); color: var(--text); font-size: 13px;
}
.mini-map .map-notice { gap: 6px; padding: 12px; }
.mini-map .map-notice p { font-size: 12px; }

.detail-foot {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 28px; padding-top: 16px; border-top: 1px solid var(--border);
  font-size: 13px; color: var(--text-muted);
}
.detail-foot .link-btn { font-size: 13px; }

/* ==========================================================================
   Map pins and hover previews
   ========================================================================== */

.leaflet-container { font-family: var(--font-body); }

/* Leaflet's controls are white by default; follow the palette instead. */
.leaflet-bar a,
.leaflet-bar a:hover { background: var(--surface); color: var(--text); border-bottom-color: var(--border); }
.leaflet-bar a:hover { background: var(--surface-2); }
.leaflet-touch .leaflet-bar { border-color: var(--border); }
.leaflet-container .leaflet-control-attribution { background: color-mix(in srgb, var(--surface) 80%, transparent); color: var(--text-muted); }
.leaflet-control-attribution a { color: var(--text-muted); }

.pin-wrap { width: 0 !important; height: 0 !important; }
.pin {
  position: absolute; left: 0; top: -6px;
  transform: translate(-50%, -100%);
  padding: 5px 10px; border-radius: 999px;
  background: var(--surface); color: var(--text);
  font-size: 13px; font-weight: 700; white-space: nowrap;
  box-shadow: 0 1px 4px rgba(0, 0, 0, .28); cursor: pointer;
  transition: transform .12s;
}
.pin::after {
  content: ""; position: absolute; left: 50%; bottom: -5px; transform: translateX(-50%);
  border: 6px solid transparent; border-bottom: 0; border-top-color: var(--surface);
}
.pin:hover { transform: translate(-50%, -100%) scale(1.08); }
.pin.is-viewed { background: var(--surface-2); color: var(--text-muted); }
.pin.is-viewed::after { border-top-color: var(--surface-2); }
.pin.is-selected { background: var(--accent); color: var(--on-accent); }
.pin.is-selected::after { border-top-color: var(--accent); }

.is-zoomed-out .pin {
  top: 0; width: 14px; height: 14px; padding: 0;
  transform: translate(-50%, -50%);
  font-size: 0; background: var(--accent); border: 2px solid var(--surface);
}
.is-zoomed-out .pin::after { display: none; }
.is-zoomed-out .pin:hover { transform: translate(-50%, -50%) scale(1.3); }
.is-zoomed-out .pin.is-viewed { background: var(--text-muted); }
.is-zoomed-out .pin.is-selected { width: 18px; height: 18px; box-shadow: 0 0 0 4px var(--accent-soft), 0 1px 4px rgba(0, 0, 0, .3); }

.leaflet-tooltip.pin-preview {
  width: 240px; padding: 0; overflow: hidden; white-space: normal;
  border: 0; border-radius: var(--radius); box-shadow: var(--shadow-lg);
  background: var(--surface); color: var(--text);
}
.leaflet-tooltip.pin-preview::before { display: none; }
.pin-preview img { display: block; width: 100%; height: 140px; object-fit: cover; background: var(--surface-2); }
.pp-body { padding: 10px 12px 12px; }
.pp-row { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; font-size: 12px; color: var(--text-muted); }
.pp-row strong { font-size: 16px; color: var(--text); }
.pp-row strong span { font-size: 13px; font-weight: 400; color: var(--text-muted); }
.pp-street { margin-top: 2px; font-size: 13px; }

/* ==========================================================================
   Login: dialog and page
   ========================================================================== */

.modal {
  width: min(420px, calc(100vw - 32px)); padding: 0;
  border: 0; border-radius: var(--radius);
  background: var(--surface); color: var(--text); box-shadow: var(--shadow-lg);
}
.modal::backdrop { background: rgba(20, 16, 12, .45); }
.auth-form { position: relative; padding: 28px; }
.modal-close { position: absolute; top: 14px; right: 14px; }
.auth-title { margin: 0 32px 18px 0; font-size: 21px; }

.password-field { position: relative; }
.password-field .input { padding-right: 76px; }
.password-toggle {
  position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
  font-size: 13px; text-decoration: none;
}

.auth-page { display: flex; flex-direction: column; align-items: center; padding: 56px 16px 80px; }
.auth-card {
  width: min(420px, 100%);
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow);
}
.auth-card + .auth-lead { max-width: 420px; margin: 18px 0 0; text-align: center; }

.tabs { display: flex; margin-bottom: 20px; border-bottom: 1px solid var(--border); }
.tabs button {
  flex: 1; margin-bottom: -1px; padding: 10px;
  border: 0; border-bottom: 2px solid transparent; background: none;
  font-weight: 600; color: var(--text-muted); cursor: pointer;
}
.tabs button[aria-selected="true"] { color: var(--text); border-bottom-color: var(--accent); }

.form-error { margin: -4px 0 12px; font-size: 13px; color: #B42318; }
[data-mode="dark"] .form-error { color: #F97066; }
.form-error[hidden] { display: none; }
.modal-link { display: flex; margin: 14px auto 0; }
.fine-print { margin: 12px 0 0; font-size: 12px; color: var(--text-muted); text-align: center; }
.auth-lead { margin: 0 0 16px; color: var(--text-muted); font-size: 14px; }
.mine-note { display: flex; gap: 8px; align-items: flex-start; margin: 8px 0 0; padding: 8px 10px; border-radius: var(--radius-sm); background: var(--accent-soft); font-size: 14px; }
.mine-note .icon { flex: none; margin-top: 2px; }
.admin-tabs { display: flex; flex-wrap: wrap; gap: 4px; margin: 0 0 20px; border-bottom: 1px solid var(--border); }
.admin-tabs a { padding: 8px 12px; color: var(--text-muted); text-decoration: none; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.admin-tabs a[aria-current="page"] { color: var(--text); border-bottom-color: var(--accent); font-weight: 600; }
.admin-h2 { margin: 24px 0 12px; font-size: 18px; }
.admin-list { display: flex; flex-direction: column; gap: 10px; }
.admin-row { display: grid; grid-template-columns: 72px 1fr auto; gap: 14px; align-items: start; padding: 12px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.admin-user { grid-template-columns: 1fr auto; }
.admin-thumb { width: 72px; height: 54px; border-radius: var(--radius-sm); overflow: hidden; background: var(--surface-2); }
.admin-thumb img { width: 100%; height: 100%; object-fit: cover; }
.admin-info { display: flex; flex-direction: column; gap: 3px; min-width: 0; font-size: 14px; }
.admin-line { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.admin-actions { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
.admin-actions .btn { padding: 6px 10px; font-size: 13px; }
.admin-search { display: flex; gap: 8px; margin-bottom: 16px; }
.admin-search .input:first-child { flex: 1; }
.admin-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.admin-card { display: flex; flex-direction: column; gap: 4px; padding: 14px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); color: var(--text); text-decoration: none; }
.admin-card span { color: var(--text-muted); font-size: 13px; }
.admin-card strong { font-size: 26px; font-family: var(--font-heading); }
.admin-table-wrap { overflow-x: auto; }
.admin-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.admin-table th, .admin-table td { padding: 6px 10px; border-bottom: 1px solid var(--border); text-align: left; white-space: nowrap; }
.admin-table td:last-child { white-space: normal; }

/* An admin's photo with the admin mark, and the team badge (only admin accounts show them) */
.avatar-photo { position: relative; flex: none; display: inline-block; width: 38px; height: 38px; padding: 0; border: 0; border-radius: 50%; background: none; }
.avatar-photo img { display: block; width: 100%; height: 100%; border-radius: 50%; object-fit: cover; box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--accent); }
.avatar-photo .avatar-mark { position: absolute; right: -3px; bottom: -3px; display: flex; width: 17px; height: 17px; align-items: center; justify-content: center;
  border-radius: 50%; background: var(--accent); color: var(--on-accent); box-shadow: 0 0 0 2px var(--surface); }
.avatar-photo .avatar-mark .icon { width: 10px; height: 10px; stroke-width: 2.6; }
.avatar-photo.is-sm { width: 32px; height: 32px; }
.avatar-photo.is-lg { width: 112px; height: 112px; }
.avatar-photo.is-lg .avatar-mark { width: 30px; height: 30px; right: 2px; bottom: 2px; }
.avatar-photo.is-lg .avatar-mark .icon { width: 17px; height: 17px; }
.avatar.avatar-photo { background: none; }
.team-badge { display: inline-flex; align-items: center; gap: 4px; padding: 1px 8px 1px 6px; border-radius: 999px; background: var(--accent); color: var(--on-accent);
  font-size: 11.5px; font-weight: 600; white-space: nowrap; vertical-align: middle; }
.team-badge .icon { width: 12px; height: 12px; stroke-width: 2.6; }
.initials { flex: none; display: flex; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: 50%;
  background: var(--surface-2); color: var(--text-muted); font-weight: 700; font-size: 13px; }

/* Messages from the team: the conversation comes first, tinted; each team message shows its admin */
.chat-item.is-team { background: color-mix(in srgb, var(--accent-soft) 60%, var(--surface)); }
.chat-item.is-team:hover, .chat-item.is-team.is-current { background: var(--accent-soft); }
.team-thumb { display: flex; align-items: center; justify-content: center; color: var(--accent); background: var(--accent-soft); }
.msg-team { display: flex; gap: 8px; align-items: flex-end; max-width: 82%; align-self: flex-start; }
.msg-team .msg-body { background: var(--surface); border: 1.5px solid var(--accent); }
.msg-team-name { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 0 0 3px; font-size: 12.5px; font-weight: 600; }
.msg-about { margin: 0 0 3px; font-size: 12px; color: var(--text-muted); }
.msg-about a { color: inherit; }

/* Writing as the team (admin pages) */
.compose-card { display: flex; flex-direction: column; gap: 14px; }
.compose-card .field { display: flex; flex-direction: column; gap: 6px; }
.compose-card .seg-sm { align-self: flex-start; }
.compose-card textarea.input { min-height: 130px; resize: vertical; }
.recipient { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-2); }
.recipient .initials { background: var(--surface); }
.recipient .muted { font-size: 13px; }
.compose-from { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 14px; }
.compose-actions { display: flex; justify-content: flex-end; gap: 8px; }
.admin-toolbar { display: flex; justify-content: flex-end; gap: 8px; margin-bottom: 12px; }

/* The admin Mensajes tab: the filters (admin-messages.js) */
.cf { display: grid; grid-template-columns: minmax(260px, 1.3fr) minmax(200px, 1fr) minmax(240px, 1fr); gap: 14px 16px;
  padding: 16px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); margin-bottom: 10px; }
.cf-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.cf-label { font-size: 12.5px; font-weight: 600; color: var(--text-muted); }
.cf-field .cf-label + .input, .cf-field .cf-label:not(:first-child) { margin-top: 2px; }
.cf-row { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.cf-row .input { flex: 1; min-width: 0; }
.cf .pill { font-size: 13px; padding: 5px 10px; }
.cf .input { padding-top: 8px; padding-bottom: 8px; font-size: 14px; }
.cf-as { font-size: 13px; }
.picker { position: relative; }
.picker-chosen { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border: 1px solid var(--accent); border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--accent-soft) 50%, var(--surface)); }
.picker-chosen div { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.picker-x { border: 0; background: none; color: var(--text-muted); font-size: 18px; line-height: 1; cursor: pointer; padding: 2px 6px; }
.picker-menu { position: absolute; z-index: 20; top: calc(100% + 4px); left: 0; right: 0; padding: 4px; border: 1px solid var(--border);
  border-radius: var(--radius-sm); background: var(--surface); box-shadow: var(--shadow); }
.picker-option { display: flex; width: 100%; align-items: center; gap: 8px; padding: 7px 8px; border: 0; border-radius: 6px; background: none;
  font: inherit; font-size: 13.5px; text-align: left; color: var(--text); cursor: pointer; }
.picker-option:hover, .picker-option.is-active { background: var(--surface-2); }
.picker-option > span:nth-child(2) { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.picker-option .muted { font-size: 12px; }
.picker-none { margin: 0; padding: 8px; font-size: 13px; }
.initials.is-xs { width: 24px; height: 24px; font-size: 10.5px; }
.cf-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 12px; font-size: 13.5px; }
.cf-chip { display: inline-flex; align-items: center; gap: 4px; padding: 3px 4px 3px 10px; border-radius: 999px; background: var(--surface-2); font-size: 13px; }
.cf-chip button { border: 0; background: none; color: var(--text-muted); cursor: pointer; font-size: 15px; line-height: 1; padding: 0 4px; }
.cf-clear { font-size: 13px; padding: 4px 8px; }
.cf-count { margin-left: auto; color: var(--text-muted); }
.cf-sort { display: inline-block; width: auto; padding: 3px 8px; font-size: 13px; }
@media (max-width: 900px) { .cf { grid-template-columns: 1fr 1fr; } }
@media (max-width: 600px) { .cf { grid-template-columns: 1fr; } }

/* The admin Mensajes tab: a conversation read by an admin, each side named */
.chat.is-admin { height: 600px; }
.chat-list.is-loading { opacity: .5; }
.chat-item-people { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-item .status-chip { font-size: 11px; padding: 0 6px; }
.admin-reading { display: flex; gap: 8px; align-items: flex-start; margin: 0; padding: 8px 12px; background: #fdf1dc; color: #6b4a0f; font-size: 13px;
  border-bottom: 1px solid var(--border); }
[data-mode="dark"] .admin-reading { background: #3a2f1a; color: #f0d9a8; }
.admin-reading .icon { flex: none; margin-top: 1px; }
.msg-who { margin: 0 0 2px; font-size: 11.5px; color: var(--text-muted); }
.msg-who a { color: inherit; }
.msg.is-landlord { align-self: flex-end; }
.msg.is-landlord .msg-body { background: color-mix(in srgb, var(--accent) 16%, var(--surface)); }
.msg.is-landlord .msg-who, .msg.is-landlord .msg-time { text-align: right; }
.msg-team.is-right { align-self: flex-end; }
.msg-team.is-right .msg-team-name, .msg-team.is-right .msg-time, .msg-team.is-right .msg-about { justify-content: flex-end; text-align: right; }
.admin-thread-actions { display: flex; flex-wrap: wrap; gap: 8px; padding: 10px 12px; border-top: 1px solid var(--border); }
.admin-thread-actions .btn { font-size: 13px; padding: 7px 11px; }

/* Mi perfil */
.profile { display: grid; grid-template-columns: 180px 1fr; gap: 28px; max-width: 760px; align-items: start; }
.profile.is-plain { grid-template-columns: 1fr; max-width: 520px; }
.profile-photo { display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; }
.profile-photo-empty { display: flex; width: 112px; height: 112px; align-items: center; justify-content: center; border-radius: 50%; background: var(--surface-2); color: var(--text-muted); }
.profile-form { display: flex; flex-direction: column; gap: 16px; }
.profile-form .field { display: flex; flex-direction: column; gap: 6px; }
.profile-preview { display: flex; align-items: center; gap: 10px; padding: 12px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.hint.is-warn { color: #9a6700; }
[data-mode="dark"] .hint.is-warn { color: #e3b341; }
@media (max-width: 640px) { .profile { grid-template-columns: 1fr; } }
.danger-zone { max-width: 760px; margin-top: 48px; padding: 18px 20px; border: 1px solid #e3b4ae; border-radius: var(--radius); background: var(--surface); }
.danger-zone h2 { margin: 0 0 8px; font-size: 18px; }
.danger-zone ul { margin: 6px 0 14px; padding-left: 20px; color: var(--text-muted); font-size: 14px; }
.danger-form { display: flex; flex-direction: column; gap: 10px; max-width: 360px; }
.danger-form .field { display: flex; flex-direction: column; gap: 6px; }
.btn-danger { align-self: flex-start; background: #b3261e; border-color: #b3261e; color: #fff; }
.btn-danger:hover { background: #8f1f18; border-color: #8f1f18; }
[data-mode="dark"] .danger-zone { border-color: #6b2f2a; }

/* The admin page head, with the ES | EN switch */
.admin-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.lang-switch { display: inline-flex; padding: 3px; border-radius: 999px; background: var(--surface-2); }
.lang-switch button { border: 0; background: none; padding: 5px 12px; border-radius: 999px; font: inherit; font-size: 13px; font-weight: 600; color: var(--text-muted); cursor: pointer; }
.lang-switch button[aria-pressed="true"] { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }

/* A small segmented control (admin pages) */
.seg-sm { display: inline-flex; padding: 3px; border-radius: var(--radius-sm); background: var(--surface-2); }
.seg-sm button { border: 0; background: none; padding: 5px 10px; border-radius: 6px; font: inherit; font-size: 13px; color: var(--text-muted); cursor: pointer; }
.seg-sm button[aria-pressed="true"] { background: var(--surface); color: var(--text); font-weight: 600; box-shadow: var(--shadow-sm); }

/* The Sistema tab: the latest numbers (admin-system.js) */
.sys-head { display: flex; align-items: center; gap: 10px; margin: 0 0 12px; }
.sys-live { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--text-muted); }
.sys-live::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #2e8b57; animation: sys-pulse 1s infinite; }
@keyframes sys-pulse { 50% { opacity: .35; } }
@media (prefers-reduced-motion: reduce) { .sys-live::before { animation: none; } }
.sys-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 10px; }
.sys-card { display: flex; flex-direction: column; gap: 6px; padding: 14px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.sys-card > span:first-child { font-size: 13px; color: var(--text-muted); }
.sys-card strong { font-family: var(--font-heading); font-size: 26px; line-height: 1.1; }
.sys-card small { color: var(--text-muted); font-size: 12.5px; }
.sys-card.is-wide { grid-column: span 2; }
.sys-bar { height: 8px; border-radius: 4px; background: var(--surface-2); overflow: hidden; }
.sys-bar > i { display: block; width: 0; height: 100%; background: var(--accent); transition: width .4s; }
.sys-bar.is-warn > i { background: #c98a12; }
.sys-spark { width: 100%; height: 56px; display: block; }
.sys-spark .line { fill: none; stroke: var(--chart-1); stroke-width: 1.6; }
.sys-spark .area { fill: var(--chart-1); opacity: .12; }
@media (max-width: 560px) { .sys-card.is-wide { grid-column: auto; } }

/* The Sistema tab's 48-hour history. Chart colors were checked with the dataviz palette validator, each pair
   against its mode's card color: the brand clay deepened to clear the chroma floor (#9C5B43 reads gray on a chart),
   and blue as the second series */
:root { --chart-1: #b4532a; --chart-2: #2a78d6; }
:root[data-mode="dark"] { --chart-1: #d9714a; --chart-2: #3987e5; }
.tl { margin-top: 32px; }
.tl-head { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin: 0 0 12px; }
.tl-head h2 { margin: 0; font-size: 18px; }
.tl-head .muted { font-size: 13px; }
.tl-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 0 0 12px; }
.tl-key { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--text-muted); }
.tl-key i { display: inline-block; width: 14px; height: 2px; border-radius: 1px; background: var(--chart-1); }
.tl-key i.is-2 { background: var(--chart-2); }
.tl-key i.is-event { width: 1px; height: 12px; background: var(--text-muted); }
.tl-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.tl-grid.is-loading { opacity: .5; }
.tl-card { padding: 12px 14px 8px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); outline-offset: 2px; }
.tl-card-top { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; min-height: 22px; }
.tl-card-top h3 { margin: 0; font-size: 13.5px; font-weight: 600; }
.tl-per { font-weight: 400; }
.tl-read { display: flex; align-items: baseline; gap: 6px; font-size: 12.5px; color: var(--text-muted); white-space: nowrap; }
.tl-read strong { color: var(--text); font-size: 14px; }
.tl-line-key { display: inline-block; width: 10px; height: 2px; align-self: center; background: var(--chart-1); }
.tl-line-key.is-2 { background: var(--chart-2); }
.tl-legend { display: flex; gap: 12px; margin-top: 2px; }
.tl-svg { display: block; width: 100%; height: 150px; touch-action: pan-y; }
.tl-svg text { font-size: 11px; fill: var(--text-muted); font-variant-numeric: tabular-nums; }
.tl-svg .grid { stroke: var(--border); stroke-width: 1; }
.tl-svg .event { stroke: var(--text-muted); stroke-width: 1; opacity: .7; }
.tl-svg .line { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.tl-svg .line.s1 { stroke: var(--chart-1); }
.tl-svg .line.s2 { stroke: var(--chart-2); }
.tl-svg .area { opacity: .1; }
.tl-svg .area.s1, .tl-svg .bar, .tl-svg .dot.s1 { fill: var(--chart-1); }
.tl-svg .dot.s2 { fill: var(--chart-2); }
.tl-svg .cross { stroke: var(--text); stroke-width: 1; opacity: .55; }
.tl-svg .dot { stroke: var(--surface); stroke-width: 2; }
.tl-table-wrap { max-height: 420px; overflow: auto; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.tl-table-wrap table { width: 100%; border-collapse: collapse; font-size: 13px; font-variant-numeric: tabular-nums; }
.tl-table-wrap th, .tl-table-wrap td { padding: 6px 10px; border-bottom: 1px solid var(--border); text-align: right; white-space: nowrap; }
.tl-table-wrap th:first-child, .tl-table-wrap td:first-child { text-align: left; }
.tl-table-wrap thead th { position: sticky; top: 0; background: var(--surface); }
@media (max-width: 900px) { .tl-grid { grid-template-columns: 1fr; } }
.admin-dialog { width: min(720px, calc(100vw - 32px)); }
.admin-detail { padding: 24px; display: flex; flex-direction: column; gap: 10px; }
.admin-photos { display: flex; gap: 6px; overflow-x: auto; }
.admin-photos img { width: 96px; height: 72px; object-fit: cover; border-radius: var(--radius-sm); }
.admin-verify { display: flex; flex-direction: column; gap: 10px; padding-top: 12px; border-top: 1px solid var(--border); }
.admin-verify .field { display: flex; flex-direction: column; gap: 4px; }
.report-form .check { display: flex; gap: 8px; align-items: center; margin: 4px 0; }
@media (max-width: 760px) {
  .admin-row { grid-template-columns: 56px 1fr; }
  .admin-row .admin-actions { grid-column: 1 / -1; justify-content: flex-start; }
  .admin-user .admin-actions { grid-column: auto; }
}
/* Messages */
.avatar { position: relative; }
.unread-dot { position: absolute; top: -2px; right: -2px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--accent); color: #fff; font-size: 11px; font-weight: 700; line-height: 18px; text-align: center; }
.unread-count { display: inline-block; min-width: 20px; padding: 1px 6px; border-radius: 10px; background: var(--accent); color: #fff; font-size: 12px; font-weight: 700; text-align: center; }
.chat { display: grid; grid-template-columns: 320px 1fr; height: calc(100vh - var(--header-h) - 140px); min-height: 420px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); overflow: hidden; }
.chat-list { overflow-y: auto; border-right: 1px solid var(--border); }
.chat-list .empty-state { padding: 24px; }
.chat-item { display: flex; gap: 10px; align-items: center; padding: 12px; border-bottom: 1px solid var(--border); color: inherit; text-decoration: none; }
.chat-item:hover, .chat-item.is-current { background: var(--surface-2); }
.chat-thumb { flex: none; width: 48px; height: 48px; border-radius: var(--radius-sm); overflow: hidden; background: var(--surface-2); }
.chat-thumb img { width: 100%; height: 100%; object-fit: cover; }
.chat-item-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; font-size: 14px; }
.chat-item-top { display: flex; justify-content: space-between; gap: 8px; }
.chat-item-top .muted { font-size: 12px; white-space: nowrap; }
.chat-item-street, .chat-item-preview { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-muted); }
.chat-thread { display: flex; flex-direction: column; min-height: 0; }
.chat-pick, .chat-start { margin: auto; padding: 24px; text-align: center; }
.chat-head { display: flex; gap: 10px; align-items: center; padding: 10px 12px; border-bottom: 1px solid var(--border); }
.chat-head-info { flex: 1; min-width: 0; display: flex; flex-direction: column; font-size: 14px; }
.chat-head-info a { color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-back { display: none; }
.chat-tip { display: flex; gap: 8px; align-items: flex-start; margin: 0; padding: 8px 12px; background: var(--accent-soft); font-size: 13px; }
.chat-tip .icon { flex: none; margin-top: 2px; }
.chat-messages { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; padding: 16px 12px; }
.msg { max-width: 78%; align-self: flex-start; }
.msg.is-mine { align-self: flex-end; }
.msg-body { padding: 8px 12px; border-radius: 14px; background: var(--surface-2); white-space: pre-wrap; overflow-wrap: anywhere; }
.msg.is-mine .msg-body { background: var(--accent); color: #fff; }
.msg-time { margin-top: 2px; font-size: 11px; color: var(--text-muted); }
.msg.is-mine .msg-time { text-align: right; }
.chat-compose { display: flex; gap: 8px; align-items: flex-end; padding: 10px 12px; border-top: 1px solid var(--border); }
.chat-compose textarea { flex: 1; resize: none; }
.chat-blocked { margin: 0; padding: 12px; border-top: 1px solid var(--border); color: var(--text-muted); text-align: center; }
.admin-conversation { max-height: 60vh; border: 1px solid var(--border); border-radius: var(--radius-sm); }
@media (max-width: 760px) {
  .chat { grid-template-columns: 1fr; height: calc(100vh - var(--header-h) - 110px); }
  .chat[data-has-thread="true"] .chat-list { display: none; }
  .chat[data-has-thread="false"] .chat-thread { display: none; }
  .chat-list { border-right: 0; }
  .chat-back { display: inline-flex; }
}
.mine-thumb .draft-icon { display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; color: var(--text-muted); }
.code-input { font-size: 22px; letter-spacing: .4em; text-align: center; font-variant-numeric: tabular-nums; }
.mock-note {
  margin: 18px 0 0; padding: 8px 10px; border-radius: var(--radius-sm);
  background: var(--surface-2); font-size: 12px; color: var(--text-muted); text-align: center;
}

/* ==========================================================================
   Toast
   ========================================================================== */

.toast {
  position: fixed; left: 50%; bottom: 28px; z-index: 3000;
  max-width: min(520px, calc(100vw - 32px)); padding: 11px 18px;
  border-radius: var(--radius-sm); background: var(--text); color: var(--surface);
  font-size: 14px; box-shadow: var(--shadow-lg);
  opacity: 0; transform: translate(-50%, 16px); pointer-events: none;
  transition: opacity .2s, transform .2s;
}
.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }

/* ==========================================================================
   Services page
   ========================================================================== */

.page { max-width: 1000px; margin: 0 auto; padding: 56px 24px 80px; }

.page-hero { max-width: 640px; margin-bottom: 40px; }
.page-hero h1 { margin: 0 0 12px; font-size: 38px; }
.lead { margin: 0; font-size: 18px; color: var(--text-muted); }

.service-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.service-card {
  display: flex; flex-direction: column;
  padding: 28px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface);
}
.service-icon {
  display: flex; align-items: center; justify-content: center;
  width: 48px; height: 48px; margin-bottom: 18px; border-radius: var(--radius-sm);
  background: var(--accent-soft); color: var(--accent);
}
.service-card h2 { margin: 0 0 8px; font-size: 20px; }
.service-card > p { margin: 0 0 16px; color: var(--text-muted); }
.service-points { margin: 0 0 24px; padding: 0; list-style: none; }
.service-points li { position: relative; padding-left: 26px; margin-bottom: 8px; font-size: 14px; }
.service-points li::before {
  content: ""; position: absolute; left: 2px; top: 5px; width: 12px; height: 7px;
  border-left: 2px solid var(--accent); border-bottom: 2px solid var(--accent); transform: rotate(-45deg);
}
.service-price { margin-top: auto; margin-bottom: 16px; color: var(--text-muted); }
.service-price strong { font-size: 28px; color: var(--text); }

.how { margin-top: 64px; }
.how h2, .diy h2 { margin: 0 0 20px; font-size: 22px; }
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin: 0; padding: 0; list-style: none; }
.steps li { display: flex; gap: 14px; }
.step-n {
  display: flex; align-items: center; justify-content: center; flex: none;
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--text); color: var(--surface); font-size: 14px; font-weight: 700;
}
.steps strong { display: block; margin-bottom: 2px; }
.steps p { margin: 0; font-size: 14px; color: var(--text-muted); }

.diy {
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
  margin-top: 64px; padding: 28px; border-radius: var(--radius); background: var(--surface-2);
}
.diy h2 { margin-bottom: 4px; }
.diy p { margin: 0; color: var(--text-muted); }

.page .fine-print { margin-top: 32px; text-align: left; }

/* ==========================================================================
   Shared page pieces: headings, notices, empty states
   ========================================================================== */

.page-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 24px; }
.page-head h1 { margin: 0; font-size: 32px; }
.page-head p { margin: 0; }
.muted { color: var(--text-muted); }

.empty-state {
  grid-column: 1 / -1;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 64px 24px; text-align: center; color: var(--text-muted);
  border: 1px dashed var(--border); border-radius: var(--radius);
}
.empty-state h2 { margin: 8px 0 0; font-size: 20px; color: var(--text); }
.empty-state p { margin: 0 0 14px; }
.empty-state .link-btn { margin-top: 10px; font-size: 13px; }

.notice {
  display: flex; align-items: center; gap: 10px; margin-bottom: 20px; padding: 12px 16px;
  border-radius: var(--radius-sm); background: var(--accent-soft); font-size: 14px;
}
.notice .icon { color: var(--accent); }
.notice .link-btn { margin-left: auto; font-size: 13px; }

.field-error { margin: 14px 0 0; font-size: 14px; font-weight: 500; color: #B42318; }
[data-mode="dark"] .field-error { color: #F97066; }
.field-error[hidden] { display: none; }
.form-warning {
  margin: 14px 0 0; padding: 10px 14px; border-radius: var(--radius-sm);
  background: var(--surface-2); font-size: 13px; color: var(--text-muted);
}
.form-warning[hidden] { display: none; }
.field-label { display: block; margin-bottom: 8px; font-size: 13px; font-weight: 600; }

.card.is-rented .card-media img { filter: grayscale(.7); opacity: .7; }

/* ==========================================================================
   Create listing: stepper and steps
   ========================================================================== */

.page-form { max-width: 880px; padding-top: 40px; }
.form-head { margin-bottom: 24px; }
.form-head h1 { margin: 0 0 6px; font-size: 32px; }
.form-head .lead { font-size: 16px; }

.step-count { margin: 0 0 8px; font-size: 13px; font-weight: 600; color: var(--text-muted); }
.stepper {
  display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px;
  margin: 0 0 20px; padding: 0; list-style: none; counter-reset: step;
}
.step button {
  display: flex; flex-direction: column; align-items: flex-start; gap: 8px; width: 100%;
  padding: 0 0 10px; border: 0; border-bottom: 3px solid var(--border); background: none;
  text-align: left; cursor: pointer; color: var(--text-muted);
}
.step button:disabled { cursor: default; color: var(--text-muted); } /* browsers grey out disabled buttons */
.step button:not(:disabled):hover .step-label { color: var(--text); }
.step-n {
  display: flex; align-items: center; justify-content: center;
  width: 26px; height: 26px; border-radius: 50%;
  background: var(--surface-2); color: var(--text-muted); font-size: 13px; font-weight: 700;
}
.step-label { font-size: 13px; font-weight: 500; line-height: 1.3; }
.step.is-done button { border-bottom-color: var(--accent); color: var(--text); }
.step.is-done .step-n { background: var(--accent); color: var(--on-accent); }
.step.is-current button { border-bottom-color: var(--text); color: var(--text); }
.step.is-current .step-n { background: var(--text); color: var(--surface); }
.step.is-current .step-label { font-weight: 700; }

.form-card {
  padding: 32px; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius);
}
.form-card h2 { margin: 0 0 6px; font-size: 24px; }
.form-card h2:focus { outline: none; }
.step-lead { margin: 0 0 24px; color: var(--text-muted); max-width: 640px; }
.form-card h2 + :not(.step-lead) { margin-top: 20px; } /* a step without a lead (the price) */
.sub-title { margin: 32px 0 12px; font-size: 17px; }
.optional-tag {
  margin-left: 6px; padding: 2px 8px; border-radius: 999px; background: var(--surface-2);
  font-family: var(--font-body); font-size: 12px; font-weight: 500; color: var(--text-muted); letter-spacing: 0;
}

.form-nav { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 20px; }
.form-nav-right { display: flex; align-items: center; gap: 18px; margin-left: auto; }
.form-help { margin: 28px 0 0; font-size: 14px; color: var(--text-muted); text-align: center; }
.form-help a { color: var(--accent); font-weight: 600; }

/* Photos */
.dropzone {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 32px 20px; border: 2px dashed var(--border); border-radius: var(--radius);
  background: var(--bg); text-align: center; color: var(--text-muted); transition: border-color .15s, background-color .15s;
}
.dropzone p { margin: 0; }
.dropzone strong { color: var(--text); }
.dropzone .btn { margin: 6px 0; }
.dropzone.is-over { border-color: var(--accent); background: var(--accent-soft); }
.processing[hidden] { display: none; }
.processing { font-weight: 600; color: var(--accent); }

.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin-top: 16px; }
.photo-grid:empty { display: none; }
.photo-tile {
  position: relative; aspect-ratio: 4 / 3; overflow: hidden; border-radius: var(--radius-sm);
  background: var(--surface-2); cursor: grab;
}
.photo-tile img { display: block; width: 100%; height: 100%; object-fit: cover; pointer-events: none; }
.photo-tile.is-dragging { opacity: .4; }
.cover-badge {
  position: absolute; left: 8px; bottom: 8px; padding: 2px 8px; border-radius: 999px;
  background: rgba(0, 0, 0, .65); color: #fff; font-size: 12px; font-weight: 600;
}
.tile-actions { position: absolute; top: 6px; right: 6px; display: flex; gap: 4px; }
.tile-btn {
  display: flex; align-items: center; justify-content: center; width: 28px; height: 28px;
  border: 0; border-radius: 50%; background: rgba(255, 255, 255, .92); color: #222; cursor: pointer;
  box-shadow: var(--shadow-sm);
}
.tile-btn:hover { background: #fff; }

.video-body { margin-top: 14px; }
.video-body:empty { display: none; }
.video-file {
  display: flex; align-items: center; gap: 10px; padding: 12px 14px;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
}
.video-file .link-btn { margin-left: auto; }
.video-body .hint .icon { display: inline; vertical-align: -2px; color: var(--accent); }

/* Location */
.location-fields { display: grid; grid-template-columns: 1fr auto; gap: 20px; align-items: start; }
.combo { position: relative; }
.combo-list {
  position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 1200;
  max-height: 300px; overflow-y: auto; margin: 0; padding: 4px; list-style: none;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); box-shadow: var(--shadow-lg);
}
.combo-list[hidden] { display: none; }
.combo-list li {
  display: flex; align-items: baseline; justify-content: space-between; gap: 12px;
  padding: 9px 10px; border-radius: calc(var(--radius-sm) - 2px); cursor: pointer; font-size: 14px;
}
.combo-list li small { color: var(--text-muted); font-size: 12px; white-space: nowrap; }
.combo-list li:hover, .combo-list li[aria-selected="true"] { background: var(--surface-2); }
.location-map {
  position: relative; height: 380px; margin-top: 4px; overflow: hidden; isolation: isolate;
  border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface-2);
}
.loc-pin-wrap { width: 0 !important; height: 0 !important; }
.loc-pin {
  position: absolute; left: 0; top: 0; transform: translate(-50%, -100%) translateY(-6px);
  display: flex; align-items: center; justify-content: center; width: 36px; height: 36px;
  border-radius: 50% 50% 50% 0; rotate: -45deg; transform-origin: center;
  background: var(--accent); color: var(--on-accent); box-shadow: 0 2px 6px rgba(0, 0, 0, .35); cursor: grab;
}
.loc-pin .icon { rotate: 45deg; }
.suggestion {
  display: flex; align-items: center; gap: 10px; margin-top: 12px; padding: 10px 14px;
  border-radius: var(--radius-sm); background: var(--accent-soft); font-size: 14px;
}
.suggestion[hidden] { display: none; }
.suggestion .icon { color: var(--accent); }
.suggestion .btn { margin-left: auto; height: 34px; font-size: 13px; }

/* Price */
.price-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; max-width: 640px; align-items: start; }
.price-fields .input-prefix { flex: none; } /* it grows sideways in the filters, but here it would grow downwards */
.price-fields .input { font-size: 18px; font-weight: 600; height: 48px; }
.price-fields .input-prefix span { font-size: 16px; }
.price-fields .input-prefix .input { padding-left: 38px; }
.price-fields .check { margin-top: 4px; }

/* Description */
.textarea { height: auto; min-height: 180px; padding: 12px; line-height: 1.5; resize: vertical; }
.counter { align-self: flex-end; }
.tips {
  display: flex; gap: 10px; align-items: flex-start; margin: 4px 0 0; padding: 12px 14px;
  border-radius: var(--radius-sm); background: var(--surface-2); font-size: 14px; color: var(--text-muted);
}
.tips .icon { margin-top: 2px; color: var(--accent); }

/* Details */
.detail-groups { display: grid; grid-template-columns: 1fr 1fr; gap: 24px 32px; }
.detail-group .pill { min-width: 52px; }
.detail-group-wide { grid-column: 1 / -1; }

/* Review */
.review { display: grid; grid-template-columns: 280px 1fr; gap: 32px; align-items: start; }
.review-preview .card { cursor: default; }
.review-list { margin: 0; }
.review-row {
  display: grid; grid-template-columns: 120px 1fr auto; gap: 12px; align-items: baseline;
  padding: 12px 0; border-bottom: 1px solid var(--border); font-size: 14px;
}
.review-row:last-child { border-bottom: 0; } /* the contact section's line follows */
.review-row dt { font-weight: 600; }
.review-row dd { margin: 0; min-width: 0; }
.review-row .link-btn { font-size: 13px; }
.contact-choice { margin-top: 28px; padding-top: 4px; border-top: 1px solid var(--border); }
.contact-choice .sub-title { margin-top: 24px; }
.contact-always { display: flex; gap: 10px; align-items: flex-start; margin: 0 0 14px; font-size: 14px; }
.contact-always .icon { flex: none; margin: 1px -2px 0; color: var(--accent); }
.review-note {
  display: flex; gap: 10px; align-items: flex-start; margin: 24px 0 0; padding: 12px 14px;
  border-radius: var(--radius-sm); background: var(--surface-2); font-size: 14px; color: var(--text-muted);
}
.review-note .icon { flex: none; margin-top: 2px; color: var(--accent); }
.clamp { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.phone-field { margin-top: 24px; max-width: 320px; }
.phone-field .input { font-size: 17px; letter-spacing: .02em; }

/* ==========================================================================
   My listings
   ========================================================================== */

.success-box {
  display: flex; gap: 18px; margin-bottom: 24px; padding: 24px;
  border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface);
}
.success-icon {
  display: flex; align-items: center; justify-content: center; flex: none;
  width: 44px; height: 44px; border-radius: 50%; background: var(--accent); color: var(--on-accent);
}
.success-body h2 { margin: 2px 0 4px; font-size: 21px; }
.success-body > p { margin: 0 0 14px; color: var(--text-muted); }
.success-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.success-pitch {
  display: flex; align-items: center; gap: 8px; margin: 18px 0 0; padding-top: 14px;
  border-top: 1px solid var(--border); font-size: 14px; color: var(--text-muted);
}
.success-pitch a { color: var(--accent); font-weight: 600; }

.draft-row {
  display: flex; align-items: center; gap: 16px; margin-bottom: 16px; padding: 14px 16px;
  border: 1px dashed var(--border); border-radius: var(--radius); background: var(--surface);
}
.draft-row img { width: 72px; height: 54px; object-fit: cover; border-radius: var(--radius-sm); }
.draft-icon {
  display: flex; align-items: center; justify-content: center; width: 72px; height: 54px;
  border-radius: var(--radius-sm); background: var(--surface-2); color: var(--text-muted);
}
.draft-info { display: flex; flex-direction: column; font-size: 14px; }
.draft-info span { color: var(--text-muted); }
.row-actions { display: flex; align-items: center; gap: 16px; margin-left: auto; }

.mine-list { display: flex; flex-direction: column; gap: 12px; }
.mine-row {
  display: grid; grid-template-columns: 176px 1fr auto; gap: 20px; align-items: center;
  padding: 14px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface);
}
.mine-thumb { display: block; aspect-ratio: 4 / 3; overflow: hidden; border-radius: var(--radius-sm); background: var(--surface-2); }
.mine-thumb img { display: block; width: 100%; height: 100%; object-fit: cover; }
.mine-row.is-rented .mine-thumb img { filter: grayscale(.7); opacity: .7; }
.mine-status { display: flex; align-items: center; gap: 10px; font-size: 13px; }
.status-chip {
  padding: 2px 10px; border-radius: 999px; background: var(--surface-2);
  font-size: 12px; font-weight: 600; color: var(--text-muted);
}
.status-chip.is-active { background: var(--accent-soft); color: var(--accent-hover); }
[data-mode="dark"] .status-chip.is-active { color: var(--accent); }
.mine-price { margin-top: 6px; font-family: var(--font-heading); font-weight: var(--heading-weight); font-size: 20px; }
.mine-price span { font-family: var(--font-body); font-size: 14px; font-weight: 400; color: var(--text-muted); }
.mine-street { font-size: 14px; }
.mine-stats { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: 8px; font-size: 13px; color: var(--text-muted); }
.mine-stats span { display: inline-flex; align-items: center; gap: 6px; }
.mine-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: 8px; max-width: 330px; }
.mine-actions .btn { height: 36px; font-size: 13px; }

/* Video links in the listing gallery */
.gallery-stage iframe { display: block; width: 100%; height: 100%; border: 0; }
.video-link-cover {
  position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
  background: rgba(0, 0, 0, .45); color: #fff; font-weight: 600; text-decoration: none;
}
.video-link-play {
  display: flex; align-items: center; justify-content: center; width: 60px; height: 60px; border-radius: 50%;
  background: rgba(255, 255, 255, .95); color: #1a1a1a;
}

/* ==========================================================================
   Logo options page (mockup only)
   ========================================================================== */

.page-wide { max-width: 1200px; }

.logo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(340px, 100%), 1fr)); gap: 20px; }
.logo-card {
  display: flex; flex-direction: column; overflow: hidden;
  border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface);
}
.logo-stage {
  display: flex; align-items: center; justify-content: center;
  height: 200px; background: var(--bg); border-bottom: 1px solid var(--border);
}
.logo-big-word .logo-wordmark { font-size: 56px; }
.logo-body { display: flex; flex-direction: column; flex: 1; padding: 18px 20px 20px; }
.logo-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.logo-head h2 { margin: 0; font-size: 19px; }
.logo-head .btn { height: 34px; font-size: 13px; }
.logo-in-use { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; font-weight: 600; color: var(--text-muted); }
.logo-body p { margin: 8px 0 16px; font-size: 14px; color: var(--text-muted); }
.logo-samples { display: flex; align-items: center; gap: 16px; margin-top: auto; }
.logo-lockup { display: flex; align-items: center; gap: 9px; flex: 1; min-width: 0; }
.logo-sizes { display: flex; align-items: flex-end; gap: 8px; }
.logo-dark {
  display: flex; align-items: center; justify-content: center;
  height: 56px; min-width: 56px; padding: 0 10px; border-radius: var(--radius-sm); background: #221F1C;
}
.logo-dark .logo-wordmark { font-size: 20px; }

/* ==========================================================================
   Pieces that only appear on phones (hidden on desktop by default)
   ========================================================================== */

.phone-menu,
.label-short,
.step-count-name,
.detail-bar,
.sheet-head,
.sheet-backdrop { display: none; }

.menu button .icon, .menu a .icon { display: inline-block; vertical-align: -3px; margin-right: 8px; color: var(--text-muted); }

/* Map pin preview (phones): a card at the bottom of the map */
.map-preview { position: absolute; left: 12px; right: 12px; bottom: 16px; z-index: 1100; }
.map-preview[hidden] { display: none; }
.map-preview-card {
  display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px;
  border: 0; border-radius: var(--radius); background: var(--surface); color: var(--text);
  box-shadow: var(--shadow-lg); text-align: left; cursor: pointer;
}
.map-preview-card img { flex: none; width: 96px; height: 72px; object-fit: cover; border-radius: var(--radius-sm); background: var(--surface-2); }
.map-preview-card > .icon { margin-left: auto; color: var(--text-muted); }
.map-preview-info { display: flex; flex-direction: column; gap: 2px; min-width: 0; font-size: 14px; }
.map-preview-info strong { font-family: var(--font-heading); font-weight: var(--heading-weight); font-size: 18px; }
.map-preview-info strong span { font-family: var(--font-body); font-weight: 400; font-size: 13px; color: var(--text-muted); }
.map-preview-info > span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.map-preview-info small { font-size: 12px; color: var(--text-muted); }
.map-preview-close {
  position: absolute; top: -12px; right: -4px;
  display: flex; align-items: center; justify-content: center; width: 30px; height: 30px;
  border: 1px solid var(--border); border-radius: 50%; background: var(--surface); color: var(--text); cursor: pointer;
  box-shadow: var(--shadow-sm);
}

/* ==========================================================================
   Phones and small tablets (up to 900px): listings open full screen
   ========================================================================== */

/* Tablets and small laptops: drop the header tagline and the listing count
   before the header and the listing bar get too wide. */
@media (max-width: 1100px) {
  .header-tagline { display: none; }
}

@media (max-width: 900px) {
  .toolbar .list-count { display: none; } /* the "Nuevo" badges and the divider say it */

  /* The listing covers the whole screen, above the header; the browser's back
     button (or the ×) closes it. */
  .detail-pane {
    position: fixed; inset: 0; z-index: 1500;
    width: auto; height: auto; border: 0;
  }
  [data-detail="closed"] .detail-pane { display: none; }
  body[data-detail="open"] { overflow: hidden; }

  .map-pane { height: calc(100vh - var(--sticky-top)); height: calc(100dvh - var(--sticky-top)); }

  .gallery { aspect-ratio: 4 / 3; }
  .detail-close { width: 40px; height: 40px; }
  .contact-slot { display: none; } /* the bottom bar takes its place */

  .detail-bar {
    position: sticky; bottom: 0; z-index: 5;
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
    background: var(--surface); border-top: 1px solid var(--border);
    box-shadow: 0 -4px 16px rgba(0, 0, 0, .06);
  }
  .bar-info { display: flex; align-items: baseline; gap: 4px; min-width: 0; }
  .bar-info span { font-size: 14px; color: var(--text-muted); }
  .bar-price { font-family: var(--font-heading); font-weight: var(--heading-weight); font-size: 22px; }
  .bar-info:has(.bar-label) { flex-direction: column; gap: 0; }
  .bar-label { font-size: 12px; }
  .bar-info:has(.bar-label) strong { font-size: 18px; letter-spacing: .02em; }
  .bar-actions { display: flex; gap: 8px; }
  .detail-bar .btn-lg { height: 46px; }
}

/* ==========================================================================
   Phones (up to 760px)
   ========================================================================== */

@media (max-width: 760px) {
  :root { --header-h: 56px; --toolbar-h: 56px; }

  /* Header: logo, "Publicar" and the menu */
  .site-header { gap: 8px; padding: 0 8px 0 16px; }
  .header-tagline,
  .header-nav .nav-link,
  .header-prefs,
  #auth-slot { display: none; }
  .phone-menu { display: block; }
  .menu-btn { width: 44px; height: 44px; color: var(--text); }
  .header-cta { height: 38px; padding: 0 14px; }
  .label-long { display: none; }
  .label-short { display: inline; }
  .logo-text { font-size: 20px; }

  /* Carousel: just the title and the tabs */

  /* Listing bar */
  .toolbar { padding: 0 16px; }
  .toolbar-controls { gap: 8px; width: 100%; }
  .segmented button { padding: 0 12px; }
  /* The sort menu takes whatever room is left, so the bar never gets wider than the screen. */
  .sort-control { flex: 0 1 170px; margin-left: auto; min-width: 0; }
  .sort-control select { width: 100%; padding: 0 30px 0 12px; font-size: 13px; }
  .list-pane { padding: 16px 16px 24px; }
  .grid { gap: 24px 16px; }

  /* Filters: a sheet from the bottom */
  .popover {
    position: fixed; left: 0; right: 0; bottom: 0; top: auto; z-index: 1600;
    width: auto; max-height: 85vh; max-height: 85dvh; overflow-y: auto;
    padding: 0 20px; border-radius: 16px 16px 0 0; border-width: 1px 0 0;
  }
  .sheet-head {
    position: sticky; top: 0; z-index: 1;
    display: flex; align-items: center; justify-content: space-between;
    margin: 0 -20px 16px; padding: 14px 12px 14px 20px;
    background: var(--surface); border-bottom: 1px solid var(--border); font-size: 17px;
  }
  .popover-foot {
    position: sticky; bottom: 0; margin: 0 -20px; padding: 14px 20px calc(14px + env(safe-area-inset-bottom));
    background: var(--surface);
  }
  .popover-foot .btn { height: 48px; padding: 0 24px; font-size: 15px; }
  body.sheet-open { overflow: hidden; }
  body.sheet-open .toolbar { z-index: 1600; } /* lift the sheet above the dimmed page */
  body.sheet-open .sheet-backdrop { display: block; position: fixed; inset: 0; z-index: 1550; background: rgba(20, 16, 12, .45); }

  /* Ordinary pages */
  .page { padding: 28px 16px 56px; }
  .page-head h1, .form-head h1 { font-size: 26px; }
  .page-hero h1 { font-size: 28px; }
  .lead { font-size: 16px; }
  .service-grid, .steps { grid-template-columns: 1fr; }
  .service-card { padding: 22px; }
  .how, .diy { margin-top: 40px; }
  .diy { flex-direction: column; align-items: flex-start; padding: 22px; }
  .auth-page { padding: 24px 16px 56px; }

  /* Create listing */
  .page-form { padding-top: 24px; }
  .form-head .lead { font-size: 15px; }
  .form-head.is-later { display: none; } /* after the first step the step's own question is the title */
  .step-count-name { display: inline; }
  .stepper { gap: 4px; margin-bottom: 16px; }
  .step button { padding: 0; border-bottom-width: 4px; border-radius: 2px; }
  .step-n, .step-label { display: none; }
  .form-card { padding: 20px 16px; }
  .form-card h2 { font-size: 21px; }
  .location-fields,
  .price-fields,
  .detail-groups,
  .review { grid-template-columns: 1fr; }
  .location-map { height: 300px; }
  .review-preview { max-width: 320px; }
  .review-row { grid-template-columns: 1fr auto; gap: 4px 12px; }
  .review-row dt { grid-column: 1 / -1; }
  .photo-grid { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 8px; } /* room for a tile's three buttons */
  .tile-btn { width: 32px; height: 32px; }
  .form-nav {
    position: sticky; bottom: 0; z-index: 5;
    margin: 20px -16px 0; padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
    background: var(--bg); border-top: 1px solid var(--border);
  }
  .form-nav-right { gap: 12px; }

  /* My listings */
  .mine-row { grid-template-columns: 104px 1fr; gap: 12px; padding: 12px; align-items: start; }
  .mine-actions { grid-column: 1 / -1; justify-content: flex-start; max-width: none; }
  .mine-price { font-size: 18px; }
  .mine-status { flex-wrap: wrap; gap: 4px 8px; }
  .success-box { flex-direction: column; gap: 12px; padding: 18px; }
  .draft-row { flex-wrap: wrap; }
  .row-actions { width: 100%; margin-left: 0; justify-content: flex-end; }

  .page-head .btn { display: none; } /* the header's "Publicar" does the same */

  /* The design options are for choosing a look on a computer; on a phone the
     button would sit on top of the content. Messages sit above the bottom bars. */
  .toast { bottom: 96px; }
}

/* Small phones: the Lista/Mapa buttons show only their icons. */
@media (max-width: 480px) {
  .segmented [data-i18n] { display: none; }
}

/* Sideways swipes on photos flip through them (see onSwipe in common.js); this
   tells the browser so it doesn't treat them as "go back" or scroll the page
   sideways. Vertical scrolling and pinch-zoom still work. */
.card-media, .gallery { touch-action: pan-y pinch-zoom; }

/* Touch screens can't drag files or photos around, so don't mention it. */
@media (hover: hover) {
  .touch-only { display: none; }
}
@media (hover: none) {
  .drag-only { display: none; }
  .carousel-btn { display: none; } /* swipe instead */
}
