/* ============================================================
   Villanis Properties — Laguna secondary market listings site
   Design tokens — dark luxury, warm antique gold on charcoal
   ============================================================ */
:root {
  --bg: #1C201A;
  --bg-elevated: #242925;
  --surface: #262B24;
  --surface-alt: #2E3329;
  --ink: #EDE8DA;
  --ink-soft: #B7B09C;
  --ink-faint: #7C7768;
  --gold: #B08A59;
  --gold-bright: #CBA36F;
  --gold-dim: #8C6B41;
  --gold-wash: rgba(176, 138, 89, 0.12);
  --line: #383D32;
  --line-soft: #2C3128;
  --danger: #B5654A;
  --danger-bright: #C97A5F;
  --pin-sp: #B08A59;
  --pin-bi: #8FA07E;
  --pin-sr: #9B7B9A;

  --font-display: "Fraunces", Georgia, serif;
  --font-body: "IBM Plex Sans", -apple-system, "Segoe UI", sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, monospace;

  --radius-sm: 8px;
  --radius: 14px;
  --radius-lg: 20px;
  --pill: 999px;
  --shadow-card: 0 1px 0 rgba(255,255,255,0.03) inset, 0 10px 28px rgba(0,0,0,0.32);
  --shadow-modal: 0 24px 64px rgba(0,0,0,0.55);
  --header-h: 76px;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
input, textarea, select { font-family: inherit; }

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

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--gold);
  color: #1C1508;
  padding: 12px 18px;
  border-radius: 0 0 8px 0;
  font-weight: 600;
  z-index: 100;
}
.skip-link:focus { left: 0; }

.wrap {
  max-width: 1160px;
  margin: 0 auto;
  padding: 0 24px;
}

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 500;
  color: var(--ink);
  margin: 0 0 0.4em;
  letter-spacing: -0.01em;
  line-height: 1.15;
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold-bright);
}

/* Page transition */
#app { animation: fadeIn 0.35s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ---------------- Nav ---------------- */
.site-nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(28, 32, 26, 0.88);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.site-nav .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-h);
}
.brand {
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink);
  line-height: 1.5;
}
.brand-sub {
  display: block;
  font-size: 10.5px;
  color: var(--gold-bright);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.nav-desktop { display: flex; align-items: center; gap: 10px; }
.hamburger {
  display: none;
  background: none;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  width: 44px;
  height: 44px;
  align-items: center;
  justify-content: center;
  color: var(--ink);
}

.dropdown { position: relative; }
.dropdown-btn {
  background: transparent;
  border: 1px solid var(--gold-dim);
  color: var(--ink);
  padding: 12px 20px;
  border-radius: var(--pill);
  font-size: 14px;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
}
.dropdown-btn:hover { border-color: var(--gold); background: var(--gold-wash); }
.dropdown-btn .chev { transition: transform 0.15s ease; }
.dropdown.open .dropdown-btn .chev { transform: rotate(180deg); }

.dropdown-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 10px);
  background: var(--bg-elevated);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  min-width: 270px;
  padding: 8px;
  display: none;
}
.dropdown.open .dropdown-menu { display: block; }
.dropdown-menu button {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  padding: 13px 14px;
  border-radius: var(--radius-sm);
  font-size: 14.5px;
  color: var(--ink);
  min-height: 44px;
}
.dropdown-menu button:hover { background: var(--surface-alt); }
.dropdown-menu .dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }

/* Mobile nav sheet */
.mobile-nav-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(10,12,9,0.6);
  z-index: 60;
}
.mobile-nav-overlay.open { display: block; }
.mobile-nav-sheet {
  position: fixed;
  top: 0; right: 0; bottom: 0;
  width: min(320px, 84vw);
  background: var(--bg-elevated);
  border-left: 1px solid var(--line);
  padding: 24px;
  transform: translateX(100%);
  transition: transform 0.25s ease;
}
.mobile-nav-overlay.open .mobile-nav-sheet { transform: translateX(0); }
.mobile-nav-sheet .close-btn {
  background: none; border: 1px solid var(--line); border-radius: var(--radius-sm);
  width: 44px; height: 44px; color: var(--ink); margin-bottom: 24px;
}
.mobile-nav-sheet a, .mobile-nav-sheet button.nav-city {
  display: flex; align-items: center; gap: 12px;
  width: 100%; text-align: left; background: none; border: none;
  color: var(--ink); font-size: 16px; padding: 14px 4px;
  border-bottom: 1px solid var(--line-soft); min-height: 44px;
}

/* ---------------- Buttons ---------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 26px;
  border-radius: var(--pill);
  font-size: 15px;
  font-weight: 600;
  border: 1px solid transparent;
  min-height: 48px;
}
.btn-primary { background: var(--gold); color: #1C1508; }
.btn-primary:hover { background: var(--gold-bright); }
.btn-ghost {
  background: transparent;
  border: 1px solid var(--gold-dim);
  color: var(--ink);
}
.btn-ghost:hover { border-color: var(--gold); background: var(--gold-wash); }
.btn-sm { padding: 9px 16px; font-size: 13.5px; min-height: 38px; }
.btn-danger { background: transparent; border: 1px solid var(--danger); color: var(--danger-bright); }
.btn-danger:hover { background: rgba(181,101,74,0.14); }
.btn-icon { padding: 0; width: 40px; height: 40px; border-radius: var(--radius-sm); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }

/* ---------------- Hero ---------------- */
.hero { padding: 56px 0 60px; }
.hero .wrap {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 56px;
  align-items: center;
}
.hero h1 {
  font-size: clamp(34px, 4.4vw, 54px);
  font-weight: 400;
  color: var(--gold-bright);
}
.hero p.lead {
  font-size: 17.5px;
  color: var(--ink-soft);
  max-width: 48ch;
  margin: 18px 0 30px;
}
.hero-actions { display: flex; gap: 14px; flex-wrap: wrap; }

.hero-media {
  position: relative;
  aspect-ratio: 4 / 3.3;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--gold-dim);
  background: var(--surface);
}
.hero-slideshow { position: relative; width: 100%; height: 100%; }
.hero-slideshow img {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; opacity: 0; transition: opacity 1.1s ease;
}
.hero-slideshow img.active { opacity: 1; }
.hero-slideshow::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(28,32,26,0) 55%, rgba(20,23,17,0.55) 100%);
  pointer-events: none;
}
.hero-nav.prev { left: 14px; }
.hero-nav.next { right: 14px; }
.hero-dots {
  position: absolute;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
  z-index: 2;
}
.hero-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: rgba(237,232,218,0.35);
  border: none;
  padding: 0;
}
.hero-dot.active { background: var(--gold-bright); width: 22px; border-radius: 4px; transition: width 0.25s ease, background 0.25s ease; }

/* ---------------- Broker intro ---------------- */
.broker {
  background: var(--bg-elevated);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 60px 0;
}
.broker .wrap {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 40px;
  align-items: start;
}
.broker-photo {
  width: 200px;
  height: 200px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--gold-dim);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: var(--ink-faint);
  font-family: var(--font-mono);
  font-size: 12px;
  padding: 12px;
  line-height: 1.5;
}
.broker-photo img { width: 100%; height: 100%; object-fit: cover; }
.broker-name { font-size: 24px; margin-bottom: 4px; color: var(--ink); }
.broker-role { color: var(--gold-bright); font-size: 14px; margin-bottom: 16px; font-family: var(--font-mono); letter-spacing: 0.03em; }
.broker-bio { max-width: 62ch; color: var(--ink-soft); margin-bottom: 18px; }
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.04em;
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--ink-soft);
  padding: 6px 12px;
  border-radius: var(--pill);
  margin-right: 8px;
}

/* ---------------- Browse / city cards ---------------- */
.browse { padding: 64px 0; }
.browse h2 { font-size: 28px; }
.browse .sub { color: var(--ink-soft); margin-bottom: 32px; }
.city-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
.city-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 26px;
  text-align: left;
  min-height: 44px;
}
.city-card:hover { border-color: var(--gold-dim); background: var(--surface-alt); }
.city-card .dot { width: 10px; height: 10px; border-radius: 50%; margin-bottom: 16px; }
.city-card h3 { font-size: 19px; margin-bottom: 6px; font-weight: 500; }
.city-card .count { color: var(--ink-soft); font-size: 13.5px; font-family: var(--font-mono); }

/* ---------------- Page header (city / listing) ---------------- */
.page-header { padding: 44px 0 8px; }
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  color: var(--ink-soft);
  margin-bottom: 20px;
  min-height: 44px;
}
.back-link:hover { color: var(--gold); }
.page-header h1 { font-size: 32px; }
.page-header .count { color: var(--ink-soft); font-size: 14.5px; font-family: var(--font-mono); }

.route-trail {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 20px 0 8px;
  flex-wrap: wrap;
}
.route-trail .stop {
  display: inline-block;
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--line);
  flex: none;
  cursor: pointer;
}
.route-trail .stop:hover, .route-trail .stop.active { background: var(--gold); }
.route-trail .seg { flex: 0 0 32px; height: 1px; background: var(--line); }
.route-trail .stop-label {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-faint);
  margin-right: 4px;
  cursor: pointer;
  padding: 6px 2px;
}
.route-trail .stop-label:hover { color: var(--gold); }
.route-trail .stop-label.active { color: var(--gold-bright); font-weight: 600; }

/* ---------------- Listing grid ---------------- */
.grid-section { padding: 28px 0 80px; }
.listing-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}
.listing-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  transition: transform 0.18s ease, border-color 0.18s ease;
}
.listing-card:hover { transform: translateY(-3px); border-color: var(--gold-dim); }
.listing-card .thumb {
  aspect-ratio: 4 / 3;
  width: 100%;
  object-fit: cover;
  background: var(--surface-alt);
}
.listing-card .body { padding: 18px; }
.listing-card .placeholder-title {
  font-family: var(--font-display);
  font-size: 17px;
  color: var(--ink);
}
.listing-card .placeholder-title.is-empty { font-style: italic; color: var(--ink-faint); font-family: var(--font-body); font-size: 14.5px; }
.listing-card .view-btn {
  margin-top: 14px;
  font-size: 13px;
  font-weight: 600;
  color: var(--gold-bright);
  font-family: var(--font-mono);
  letter-spacing: 0.03em;
}

.empty-note {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--ink-faint);
  padding: 40px 0;
}

/* ---------------- Listing detail ---------------- */
.detail { padding: 32px 0 80px; }

/* Carousel mode */
.gallery-main-wrap { position: relative; }
.gallery-main {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  border-radius: var(--radius);
  background: var(--surface-alt);
  border: 1px solid var(--line);
}
.gallery-nav-btn {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 44px; height: 44px; border-radius: 50%;
  background: rgba(28,32,26,0.7); border: 1px solid var(--line);
  color: var(--ink); display: flex; align-items: center; justify-content: center;
}
.gallery-nav-btn:hover { border-color: var(--gold); }
.gallery-nav-btn.prev { left: 12px; }
.gallery-nav-btn.next { right: 12px; }
.gallery-thumbs {
  display: flex;
  gap: 10px;
  margin-top: 12px;
  overflow-x: auto;
  padding-bottom: 4px;
}
.gallery-thumbs img {
  width: 88px;
  height: 66px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  border: 2px solid transparent;
  opacity: 0.6;
  flex: none;
}
.gallery-thumbs img.active { border-color: var(--gold); opacity: 1; }
.gallery-thumbs img:hover { opacity: 1; }

/* Grid mode */
.photo-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
.photo-grid img {
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
}
.lightbox-overlay {
  display: none;
  position: fixed; inset: 0; z-index: 70;
  background: rgba(10,12,9,0.85);
  align-items: center; justify-content: center;
  padding: 24px;
}
.lightbox-overlay.open { display: flex; }
.lightbox-overlay img { max-width: 92vw; max-height: 82vh; border-radius: var(--radius); }
.lightbox-close {
  position: absolute; top: 20px; right: 20px;
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--surface); border: 1px solid var(--line); color: var(--ink);
}

.detail-body {
  margin-top: 36px;
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 44px;
}
.editable-block {
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  padding: 20px 22px;
  color: var(--ink-faint);
  font-style: italic;
  font-size: 14.5px;
  background: var(--surface);
}
.editable-block.title-block {
  font-family: var(--font-display);
  font-size: 24px;
  font-style: normal;
  color: var(--ink);
  margin-bottom: 18px;
  border-style: solid;
  border-color: var(--line);
}
.editable-block.title-block.is-empty { color: var(--ink-faint); font-style: italic; font-family: var(--font-body); font-size: 15px; border-style: dashed; }

.editable-block.spec-block { font-style: normal; padding: 6px 24px; }
.spec-list { list-style: none; margin: 0; padding: 6px 0; }
.spec-row, .spec-line {
  padding: 10px 0;
  border-bottom: 1px solid var(--line-soft);
  font-size: 14.5px;
}
.spec-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 20px;
}
.spec-row:last-child, .spec-line:last-child { border-bottom: none; }
.spec-label {
  color: var(--ink-soft);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  flex: none;
}
.spec-value { color: var(--ink); font-weight: 500; text-align: right; }
.spec-line { color: var(--ink); }
.spec-gap { height: 8px; padding: 0; margin: 0; }
@media (max-width: 480px) {
  .editable-block.spec-block { padding: 4px 16px; }
  .spec-row { flex-direction: column; gap: 2px; }
  .spec-value { text-align: left; }
}

.contact-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
  height: fit-content;
}
.contact-card .name { font-family: var(--font-display); font-size: 20px; margin-bottom: 3px; }
.contact-card .phone { color: var(--ink-soft); font-size: 14.5px; margin-bottom: 20px; font-family: var(--font-mono); }
.contact-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 13px 16px;
  border-radius: var(--pill);
  font-size: 14.5px;
  font-weight: 600;
  margin-bottom: 10px;
  border: 1px solid var(--line);
  color: var(--ink);
  background: var(--surface-alt);
  min-height: 48px;
}
.contact-btn:last-child { margin-bottom: 0; }
.contact-btn .icon { width: 20px; height: 20px; flex: none; }
.contact-btn.messenger:hover { border-color: #6E86EE; color: #93A4F5; }
.contact-btn.viber:hover { border-color: #9483F5; color: #AFA1F7; }
.contact-btn.whatsapp:hover { border-color: #3FCB84; color: #6BDA9F; }

/* ---------------- Footer ---------------- */
.site-footer {
  border-top: 1px solid var(--line);
  padding: 32px 0;
  color: var(--ink-soft);
  font-size: 13.5px;
}
.site-footer .wrap {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}
.site-footer a { color: var(--gold); }

/* ================================================================
   Admin / Listings Studio
   ================================================================ */
.admin-header {
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--line);
  padding: 28px 0;
  position: sticky;
  top: 0;
  z-index: 30;
}
.admin-header h1 { font-size: 24px; margin-bottom: 6px; }
.admin-header p { color: var(--ink-soft); font-size: 14px; margin: 0 0 16px; max-width: 78ch; }
.jump-links { display: flex; gap: 10px; flex-wrap: wrap; }
.jump-links a {
  font-family: var(--font-mono);
  font-size: 12px;
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: var(--pill);
  color: var(--ink-soft);
  min-height: 36px;
  display: inline-flex; align-items: center;
}
.jump-links a:hover { border-color: var(--gold); color: var(--gold); }

.field-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 14px;
}
.field-card label { display: block; font-family: var(--font-mono); font-size: 10.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-faint); margin: 0 0 6px; }
.field-card .hint { font-size: 12.5px; color: var(--ink-faint); margin-bottom: 12px; line-height: 1.5; }
.field-card input[type=text], .field-card input[type=number], .field-card textarea, .field-card select {
  width: 100%;
  font-family: var(--font-body);
  font-size: 14.5px;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--ink);
  margin-bottom: 4px;
  resize: vertical;
  min-height: 44px;
}
.field-card input:focus, .field-card textarea:focus, .field-card select:focus { border-color: var(--gold); outline: none; }
.field-card textarea { min-height: 70px; }

.city-block { padding: 36px 0 8px; }
.city-block-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.city-block h2 { font-size: 22px; margin: 0; }
.city-block .sub { color: var(--ink-soft); font-size: 14px; }

.listing-manage-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 14px;
  display: flex;
  gap: 14px;
  align-items: flex-start;
}
.listing-manage-card.dragging { opacity: 0.4; }
.drag-handle {
  cursor: grab;
  color: var(--ink-faint);
  padding: 10px 4px;
  flex: none;
  touch-action: none;
}
.reorder-btns { display: flex; flex-direction: column; gap: 4px; flex: none; }
.reorder-btns .btn-icon { width: 32px; height: 32px; }
.listing-manage-thumb {
  width: 90px; height: 68px; object-fit: cover; border-radius: var(--radius-sm);
  background: var(--surface-alt); border: 1px solid var(--line); flex: none;
}
.listing-manage-body { flex: 1; min-width: 0; }
.listing-manage-id { font-family: var(--font-mono); font-size: 10.5px; color: var(--ink-faint); margin-bottom: 4px; }
.listing-manage-title { font-size: 15px; color: var(--ink); margin-bottom: 2px; }
.listing-manage-title.is-empty { color: var(--ink-faint); font-style: italic; }
.listing-manage-meta { font-size: 12px; color: var(--ink-soft); font-family: var(--font-mono); }
.listing-manage-actions { display: flex; gap: 8px; flex: none; flex-wrap: wrap; }

.add-listing-btn {
  width: 100%;
  border: 1px dashed var(--gold-dim);
  border-radius: var(--radius);
  background: var(--gold-wash);
  color: var(--gold-bright);
  padding: 16px;
  font-size: 14.5px;
  font-weight: 600;
  min-height: 52px;
  margin-top: 4px;
}
.add-listing-btn:hover { border-style: solid; }

/* Modal (add/edit listing form) */
.modal-overlay {
  display: none;
  position: fixed; inset: 0; z-index: 80;
  background: rgba(10,12,9,0.72);
  align-items: flex-start; justify-content: center;
  overflow-y: auto;
  padding: 40px 16px;
}
.modal-overlay.open { display: flex; }
.modal-panel {
  background: var(--bg-elevated);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-modal);
  width: 100%;
  max-width: 720px;
  padding: 28px;
}
.modal-panel h2 { font-size: 20px; margin-bottom: 18px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 12px; margin-top: 20px; }

/* Photo manager */
.photo-manager-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 12px;
  margin: 10px 0 16px;
}
.photo-tile {
  position: relative;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 2px solid var(--line);
  aspect-ratio: 4/3;
  background: var(--surface-alt);
  cursor: grab;
}
.photo-tile.dragging { opacity: 0.35; }
.photo-tile.is-cover { border-color: var(--gold); }
.photo-tile img { width: 100%; height: 100%; object-fit: cover; }
.photo-tile .cover-badge {
  position: absolute; top: 6px; left: 6px;
  background: var(--gold); color: #1C1508;
  font-family: var(--font-mono); font-size: 9.5px; letter-spacing: 0.05em;
  padding: 3px 7px; border-radius: var(--pill); text-transform: uppercase;
}
.photo-tile .tile-actions {
  position: absolute; bottom: 6px; left: 6px; right: 6px;
  display: flex; gap: 4px; flex-wrap: wrap;
}
.photo-tile .tile-actions button {
  flex: 1 1 auto;
  min-width: 28px;
  background: rgba(10,12,9,0.75);
  border: 1px solid rgba(255,255,255,0.15);
  color: var(--ink);
  font-size: 11px;
  padding: 6px 4px;
  border-radius: var(--radius-sm);
  min-height: 30px;
}
.photo-tile .tile-actions button:disabled { opacity: 0.3; }
.photo-tile .tile-actions button:hover { background: var(--gold); color: #1C1508; }
.photo-add-tile {
  aspect-ratio: 4/3;
  border-radius: var(--radius-sm);
  border: 1px dashed var(--line);
  color: var(--ink-faint);
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; text-align: center; padding: 10px;
}
.photo-add-tile:hover { border-color: var(--gold-dim); color: var(--gold-bright); }
.photo-add-tile.disabled { opacity: 0.4; pointer-events: none; }
.photo-tile.is-inactive { opacity: 0.4; }
.photo-tile .active-toggle {
  position: absolute; top: 6px; right: 6px;
  background: rgba(10,12,9,0.75);
  border: 1px solid rgba(255,255,255,0.15);
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: 0.04em;
  padding: 3px 8px;
  border-radius: var(--pill);
  text-transform: uppercase;
}
.photo-tile.is-cover .active-toggle,
.photo-tile .active-toggle.is-active { background: var(--gold); color: #1C1508; border-color: var(--gold); }

.display-mode-toggle { display: flex; gap: 8px; margin-bottom: 4px; }
.display-mode-toggle button {
  flex: 1;
  padding: 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--ink-soft);
  font-size: 13.5px;
  min-height: 44px;
}
.display-mode-toggle button.active { border-color: var(--gold); color: var(--gold-bright); background: var(--gold-wash); }

.toolbar {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: var(--bg-elevated);
  border-top: 1px solid var(--line);
  box-shadow: 0 -8px 28px rgba(0,0,0,0.35);
  padding: 16px 0;
  z-index: 40;
}
.toolbar .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.toolbar .status { font-size: 13px; color: var(--ink-soft); }
.toolbar .status.saved { color: var(--gold); }
body.has-admin-toolbar { padding-bottom: 130px; }

/* ---------------- Responsive ---------------- */
@media (max-width: 980px) {
  .hero .wrap { grid-template-columns: 1fr; gap: 32px; }
  .hero .hero-media { order: -1; }
  .broker .wrap { grid-template-columns: 1fr; }
  .broker-photo { width: 140px; height: 140px; }
  .listing-grid { grid-template-columns: repeat(2, 1fr); }
  .detail-body { grid-template-columns: 1fr; gap: 28px; }
  .nav-desktop { display: none; }
  .hamburger { display: flex; }
}
@media (max-width: 640px) {
  .wrap { padding: 0 18px; }
  :root { --header-h: 64px; }
  .hero { padding: 36px 0 44px; }
  .hero h1 { font-size: 30px; }
  .hero p.lead { font-size: 16px; }
  .hero-actions .btn { flex: 1; }
  .broker { padding: 44px 0; }
  .browse { padding: 48px 0; }
  .city-cards { grid-template-columns: 1fr; }
  .listing-grid { grid-template-columns: 1fr; gap: 18px; }
  .page-header { padding: 28px 0 4px; }
  .page-header h1 { font-size: 26px; }
  .grid-section { padding: 20px 0 64px; }
  .photo-grid { grid-template-columns: repeat(2, 1fr); }
  .gallery-nav-btn { width: 38px; height: 38px; }
  .listing-manage-card { flex-wrap: wrap; }
  .listing-manage-actions { width: 100%; }
  .modal-panel { padding: 20px; }
  .site-footer .wrap { flex-direction: column; align-items: flex-start; }
}
@media (max-width: 380px) {
  .hero-actions { flex-direction: column; }
  .hero-actions .btn { width: 100%; }
}
