/* Bilgo Realty — mobile first, then tablet (600px+) and desktop (900px+) */
:root {
  --navy: #0f2a4a; --navy-2: #1b4273; --gold: #c9a24a; --gold-2: #a8822c; --gold-soft: #fbf5e6;
  --ink: #1b2330; --muted: #677284; --line: #e3e8ef; --bg: #f3f5f9; --card: #fff;
  --ok: #1d8a4b; --ok-soft: #e7f6ed; --warn: #c27410; --warn-soft: #fff5e3; --danger: #c2372a; --danger-soft: #fdecea;
  --radius: 14px; --radius-sm: 9px;
  --shadow: 0 1px 2px rgba(15, 42, 74, .05), 0 6px 20px rgba(15, 42, 74, .06);
  --bottom-h: 64px;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 76px; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 15px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans", sans-serif;
  -webkit-font-smoothing: antialiased; overflow-x: hidden;
}
body.no-scroll, body.filters-open { overflow: hidden; }
img, video { max-width: 100%; }
a { color: var(--navy-2); }
h1 { margin: 0; font-size: 22px; line-height: 1.25; color: var(--navy); letter-spacing: -.2px; }
h2 { margin: 0 0 12px; font-size: 16.5px; color: var(--navy); }
h3 { margin: 0; font-size: 16px; }
.muted { color: var(--muted); font-weight: 400; }
.req { color: var(--danger); }
.pre { white-space: pre-wrap; overflow-wrap: anywhere; }
.wrap { width: 100%; max-width: 1280px; margin: 0 auto; padding: 0 16px; }
main.wrap { padding-top: 14px; padding-bottom: 32px; }
body.has-bottomnav main.wrap, body.has-actionbar main.wrap { padding-bottom: calc(var(--bottom-h) + 28px + env(safe-area-inset-bottom)); }

/* ---------- Top bar ---------- */
.topbar { position: sticky; top: 0; z-index: 40; background: var(--navy); border-bottom: 3px solid var(--gold); }
.topbar-inner { display: flex; align-items: center; justify-content: space-between; gap: 12px; height: 56px; }
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; color: #fff; text-decoration: none; font-weight: 700; font-size: 17px; }
.brand-text { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; line-height: 1.15; }
.brand small { display: block; font-size: 10px; font-weight: 500; color: var(--gold); letter-spacing: 1.2px; text-transform: uppercase; }
.mark { flex: none; width: 34px; height: 34px; border-radius: 9px; background: var(--gold); color: var(--navy); display: grid; place-items: center; font-size: 19px; }
.topnav { display: none; align-items: center; gap: 6px; }
.topnav a:not(.btn) { position: relative; color: #d8e1ec; text-decoration: none; padding: 8px 12px; border-radius: 8px; font-weight: 500; }
.topnav a:not(.btn):hover, .topnav a.active { color: #fff; background: rgba(255, 255, 255, .1); }
.topnav form { margin: 0 0 0 4px; }
.topnav form .btn { background: transparent; color: #d8e1ec; border-color: rgba(255, 255, 255, .25); }
.top-logout { margin: 0 0 0 8px; }
.top-logout .icon-btn { background: transparent; color: #d8e1ec; border-color: rgba(255, 255, 255, .25); }
.top-add { flex: none; width: 38px; height: 38px; border-radius: 50%; background: var(--gold); color: var(--navy); display: grid; place-items: center; text-decoration: none; font-size: 22px; font-weight: 700; }
.badge { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--warn); color: #fff; font-size: 11.5px; font-weight: 700; line-height: 1; }
.badge-navy { background: var(--navy); }

/* ---------- Bottom navigation (phones) ---------- */
.bottomnav, .actionbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 45; display: grid; grid-auto-flow: column; grid-auto-columns: 1fr;
  background: rgba(255, 255, 255, .97); backdrop-filter: blur(8px); border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom); box-shadow: 0 -4px 20px rgba(15, 42, 74, .06);
}
.bottomnav a, .actionbar a {
  position: relative; height: var(--bottom-h); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  color: var(--muted); text-decoration: none; font-size: 11.5px; font-weight: 600;
}
.bottomnav .ico, .actionbar .ico { font-size: 21px; line-height: 1; }
.bottomnav a.active { color: var(--navy); }
.bottomnav a.active::before { content: ""; position: absolute; top: 0; left: 30%; right: 30%; height: 3px; border-radius: 0 0 3px 3px; background: var(--gold); }
.bottomnav a.add .ico { width: 46px; height: 46px; margin-top: -22px; border-radius: 50%; display: grid; place-items: center; background: var(--gold); color: var(--navy); font-size: 26px; font-weight: 700; box-shadow: 0 4px 14px rgba(201, 162, 74, .55); border: 3px solid #fff; }
.bottomnav .badge { position: absolute; top: 6px; left: calc(50% + 6px); }
.actionbar a.attn { color: var(--warn); }
.actionbar a.attn .ico { animation: nudge 2.4s ease-in-out infinite; }
@keyframes nudge { 0%, 80%, 100% { transform: none; } 88% { transform: translateY(-3px); } }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 42px; padding: 0 16px;
  border-radius: var(--radius-sm); border: 1px solid var(--line); background: #fff; color: var(--ink);
  font: inherit; font-weight: 600; text-decoration: none; cursor: pointer; white-space: nowrap; transition: background .15s, border-color .15s;
  -webkit-tap-highlight-color: transparent;
}
.btn:hover { border-color: #c5ced9; }
.btn-primary { background: var(--navy); border-color: var(--navy); color: #fff; }
.btn-primary:hover { background: var(--navy-2); border-color: var(--navy-2); }
.btn-gold { background: var(--gold); border-color: var(--gold); color: var(--navy); }
.btn-gold:hover { background: var(--gold-2); border-color: var(--gold-2); color: #fff; }
.btn-ghost-danger { color: var(--danger); border-color: transparent; background: transparent; }
.btn-ghost-danger:hover { background: var(--danger-soft); border-color: transparent; }
.btn-wa { color: #128c4a; }
.btn-sm { min-height: 34px; padding: 0 12px; font-size: 13.5px; }
.btn-lg { min-height: 50px; padding: 0 26px; font-size: 16px; }
.btn:disabled { opacity: .55; cursor: wait; }
.icon-btn {
  flex: none; display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 50%;
  border: 1px solid var(--line); background: #fff; color: var(--ink); font-size: 15px; text-decoration: none; cursor: pointer;
}
.icon-btn:hover { background: var(--bg); }
.icon-btn.danger { color: var(--danger); }
.icon-btn.danger:hover { background: var(--danger-soft); border-color: #f3c3bd; }

/* ---------- Cards, notices, toasts ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; margin-bottom: 16px; box-shadow: var(--shadow); }
.card.internal { border-left: 4px solid var(--warn); }
.card-title { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.card-title h2 { margin: 0; }
.empty { text-align: center; padding: 44px 20px; }
.empty-ico { font-size: 44px; margin-bottom: 6px; }
.empty-line { color: var(--muted); margin: 6px 0 4px; }
.notice { padding: 12px 14px; border-radius: var(--radius-sm); margin-bottom: 14px; font-size: 14.5px; }
.notice ul { margin: 6px 0 0; padding-left: 20px; }
.notice-warn { background: var(--warn-soft); color: #7a4a06; border: 1px solid #f2d7a3; }
.notice-error { background: var(--danger-soft); color: #8a1f14; border: 1px solid #f5c2bc; }
.toast {
  position: fixed; z-index: 80; left: 50%; top: 68px; transform: translateX(-50%); max-width: calc(100% - 32px);
  padding: 11px 18px; border-radius: 30px; font-weight: 600; box-shadow: 0 8px 30px rgba(0, 0, 0, .18); transition: opacity .4s, transform .4s;
}
.toast-ok { background: var(--ok); color: #fff; }
.toast-error { background: var(--danger); color: #fff; border-radius: 12px; }
.toast.hide { opacity: 0; transform: translate(-50%, -12px); pointer-events: none; }
.pill { display: inline-block; padding: 3px 10px; border-radius: 20px; font-size: 12px; font-weight: 700; }
.pill-ok { background: var(--ok-soft); color: var(--ok); }
.pill-warn { background: var(--warn); color: #fff; }
.back { display: inline-flex; align-items: center; gap: 4px; margin-bottom: 10px; color: var(--muted); text-decoration: none; font-weight: 600; font-size: 14px; padding: 4px 0; }
.back:hover { color: var(--navy); }

/* ---------- Form controls ---------- */
label { display: block; font-weight: 600; font-size: 13.5px; color: #36404f; }
label small { font-weight: 400; }
input, select, textarea {
  display: block; width: 100%; min-width: 0; margin-top: 6px; min-height: 46px; padding: 10px 12px;
  font: inherit; font-size: 16px; /* 16px stops iPhones zooming in */ font-weight: 400; color: var(--ink);
  background: #fff; border: 1px solid #cfd7e2; border-radius: var(--radius-sm); -webkit-appearance: none; appearance: none;
}
select {
  padding-right: 34px; background-repeat: no-repeat; background-position: right 12px center; background-size: 12px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%23677284' stroke-width='1.8' stroke-linecap='round'/%3E%3C/svg%3E");
}
textarea { resize: vertical; min-height: 90px; line-height: 1.5; }
input:focus, select:focus, textarea:focus { outline: 3px solid rgba(201, 162, 74, .3); border-color: var(--gold); }
input:disabled, select:disabled { background: #f4f6f9; }
input[type=checkbox] { display: inline-block; width: 20px; height: 20px; min-height: 0; margin: 0; padding: 0; appearance: auto; -webkit-appearance: checkbox; accent-color: var(--navy); }
.grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; }
.check { display: flex; align-items: center; gap: 10px; min-height: 46px; font-size: 14.5px; }
.input-group { display: flex; align-items: stretch; margin-top: 6px; }
.input-group > * { margin-top: 0; }
.input-group .prefix { display: grid; place-items: center; padding: 0 12px; background: var(--bg); border: 1px solid #cfd7e2; border-right: 0; border-radius: var(--radius-sm) 0 0 var(--radius-sm); color: var(--muted); font-weight: 600; }
.input-group input { border-radius: 0; flex: 1; }
.input-group input:first-child { border-radius: var(--radius-sm) 0 0 var(--radius-sm); }
.input-group .suffix { display: grid; place-items: center; padding: 0 14px; background: var(--bg); border: 1px solid #cfd7e2; border-left: 0; border-radius: 0 var(--radius-sm) var(--radius-sm) 0; color: var(--muted); font-weight: 600; }
.input-group select { width: 112px; flex: none; border-left: 0; border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
.price-preview { display: block; margin-top: 5px; min-height: 18px; color: var(--ok); font-weight: 600; font-size: 13px; }
.range { display: flex; align-items: center; gap: 6px; }
.range input { margin-top: 6px; }
.range-sep { color: var(--muted); padding-top: 6px; }
.step { display: inline-grid; place-items: center; width: 26px; height: 26px; margin-right: 6px; border-radius: 50%; background: var(--gold); color: var(--navy); font-size: 13px; vertical-align: 1px; }
.type-hint { margin: 0; padding: 14px; border-radius: var(--radius-sm); background: var(--bg); color: var(--muted); text-align: center; }

/* ---------- Upload boxes ---------- */
.dz-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.dropzone {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  min-height: 116px; padding: 14px 10px; text-align: center; cursor: pointer;
  border: 2px dashed #c9d2de; border-radius: var(--radius); background: #fafbfd; transition: border-color .15s, background .15s;
}
.dropzone input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.dropzone:hover, .dropzone.dragging, .dropzone:focus-within { border-color: var(--gold); background: var(--gold-soft); }
.dropzone.has-files { border-style: solid; border-color: var(--ok); background: var(--ok-soft); }
.dz-icon { font-size: 28px; line-height: 1.1; }
.dz-title { font-weight: 700; color: var(--navy); font-size: 14.5px; }
.dz-hint { font-weight: 400; color: var(--muted); font-size: 12.5px; }
.dz-files { display: flex; flex-direction: column; font-weight: 400; font-size: 12px; color: #245c3b; max-width: 100%; }
.dz-files span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dz-files strong { color: var(--ok); font-size: 13px; }
.dropzone.has-files .dz-hint { display: none; }
.dz-pdf { min-height: 130px; border-color: var(--gold); background: var(--gold-soft); }
.upload-row { display: flex; align-items: center; gap: 12px; margin-top: 12px; }
.upload-row .btn { margin-left: auto; }
.progress { position: relative; flex: 1; height: 30px; border-radius: 15px; overflow: hidden; background: #e7ebf1; }
.progress .bar { width: 0; height: 100%; background: linear-gradient(90deg, var(--navy), var(--gold)); transition: width .2s; }
.progress-text { position: absolute; inset: 0; display: grid; place-items: center; font-size: 12.5px; font-weight: 700; }

/* ---------- Property list ---------- */
.list-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.list-head p { margin: 2px 0 0; font-size: 14px; }
.list-tools { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 8px; }
.dl-pdfs b { min-width: 20px; padding: 0 6px; border-radius: 10px; background: var(--ok); color: #fff; font-size: 12px; text-align: center; }
.sort { display: flex; align-items: center; gap: 6px; font-weight: 500; }
.sort select { margin: 0; min-height: 38px; width: auto; padding: 6px 30px 6px 10px; font-size: 14px; }
.searchbar { display: flex; gap: 8px; margin-bottom: 12px; }
.search-input { position: relative; flex: 1; min-width: 0; }
.search-input span { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); font-size: 15px; pointer-events: none; }
.search-input input { margin: 0; padding-left: 40px; border-radius: 12px; min-height: 48px; box-shadow: var(--shadow); border-color: var(--line); }
.search-btn { display: none; }
.filter-toggle { min-height: 48px; border-radius: 12px; box-shadow: var(--shadow); }
.chip-row { display: flex; gap: 8px; margin: 0 -16px 12px; padding: 0 16px 2px; overflow-x: auto; scrollbar-width: none; }
.chip { flex: none; padding: 7px 13px; border-radius: 20px; background: #fff; border: 1px solid var(--line); text-decoration: none; color: var(--ink); font-size: 13.5px; font-weight: 500; white-space: nowrap; }
.chip b { color: var(--gold-2); margin-left: 2px; }
.chip.active { background: var(--navy); border-color: var(--navy); color: #fff; }
.chip.active b { color: var(--gold); }
.chip-unverified { border-color: #f2d7a3; color: var(--warn); }
.chip-unverified.active { background: var(--warn); border-color: var(--warn); }
.chip-issue { border-color: #d9c2f3; color: #7422c4; }
.chip-issue.active { background: #7422c4; border-color: #7422c4; }
.active-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 12px; }
.afilter { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: 20px; background: var(--gold-soft); border: 1px solid #efdfb6; color: #6d5316; text-decoration: none; font-size: 13px; font-weight: 600; }
.afilter span { font-size: 11px; opacity: .7; }
.clear-all { font-size: 13px; font-weight: 600; color: var(--danger); margin-left: 4px; }
.list-layout { display: block; }

/* Filter panel: bottom sheet on phones */
.filter-panel {
  position: fixed; z-index: 70; left: 0; right: 0; bottom: 0; max-height: 88vh; display: flex; flex-direction: column;
  background: #fff; border-radius: 18px 18px 0 0; box-shadow: 0 -10px 40px rgba(0, 0, 0, .2);
  transform: translateY(105%); transition: transform .25s ease; visibility: hidden;
}
body.filters-open .filter-panel { transform: none; visibility: visible; }
.fp-backdrop { position: fixed; inset: 0; z-index: 65; background: rgba(10, 20, 35, .45); opacity: 0; pointer-events: none; transition: opacity .25s; }
body.filters-open .fp-backdrop { opacity: 1; pointer-events: auto; }
.fp-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px 10px; border-bottom: 1px solid var(--line); }
.fp-head h3 { font-size: 17px; color: var(--navy); }
.fp-body { flex: 1; overflow-y: auto; padding: 14px 16px; display: flex; flex-direction: column; gap: 14px; overscroll-behavior: contain; }
.fp-foot { display: grid; grid-template-columns: 1fr 2fr; gap: 10px; padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); }
.type-filters { display: flex; flex-direction: column; gap: 14px; padding: 14px; border-radius: 12px; background: var(--gold-soft); border: 1px solid #efdfb6; }
.type-filters-title { font-weight: 700; color: var(--navy); font-size: 13.5px; }

/* Property cards: compact rows on phones */
.cards { display: grid; gap: 12px; }
.prop-card {
  display: grid; grid-template-columns: 112px minmax(0, 1fr); overflow: hidden; text-decoration: none; color: inherit;
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); transition: transform .15s, box-shadow .15s;
}
.prop-card:hover { transform: translateY(-2px); box-shadow: 0 10px 30px rgba(15, 42, 74, .12); }
.prop-card:active { transform: scale(.99); }
.thumb { position: relative; min-height: 132px; background: linear-gradient(135deg, #e8edf4, #dde4ee); display: grid; place-items: center; }
.thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.thumb .ph { font-size: 40px; opacity: .8; }
.badges { position: absolute; left: 8px; top: 8px; right: 8px; display: flex; flex-wrap: wrap; gap: 5px; }
.status { padding: 2px 8px; border-radius: 12px; font-size: 10.5px; font-weight: 700; color: #fff; background: var(--ok); box-shadow: 0 1px 4px rgba(0, 0, 0, .2); }
.status-under-negotiation { background: var(--warn); }
.status-on-hold { background: #6b7482; }
.status-sold { background: var(--danger); }
.status-has-issue { background: #8a2be2; }
.status-verified { background: #1d9bf0; }
.prop-card .body { display: flex; flex-direction: column; gap: 3px; min-width: 0; padding: 11px 12px; }
.prop-card h3 { font-size: 15px; line-height: 1.3; color: var(--navy); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.meta { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.code { font-weight: 700; color: var(--gold-2); }
.loc { margin: 0; font-size: 13px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.price { font-size: 17px; font-weight: 800; color: var(--navy); }
.price.big { font-size: 26px; letter-spacing: -.3px; }
.nego { font-size: 12.5px; color: var(--ok); font-weight: 600; letter-spacing: 0; }
.highlights { display: none; flex-wrap: wrap; gap: 5px; }
.highlights span { font-size: 12px; background: var(--bg); padding: 2px 8px; border-radius: 6px; white-space: nowrap; }
.card-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: auto; padding-top: 6px; font-size: 12.5px; }
.counts { display: flex; gap: 9px; color: var(--muted); }
.counts .q-open { color: var(--warn); font-weight: 700; }
.pdf-ok { color: var(--ok); font-weight: 700; white-space: nowrap; }
.pdf-pending { color: var(--warn); font-weight: 700; white-space: nowrap; padding: 2px 8px; border-radius: 12px; background: var(--warn-soft); border: 1px solid #f2d7a3; }
.pager { display: flex; align-items: center; justify-content: center; gap: 14px; margin-top: 22px; }
.pager a { padding: 8px 14px; border-radius: var(--radius-sm); background: #fff; border: 1px solid var(--line); text-decoration: none; font-weight: 600; }

/* ---------- Property page ---------- */
.hero { display: grid; gap: 14px; margin-bottom: 16px; }
.hero-media { position: relative; overflow: hidden; border-radius: var(--radius); background: #dfe5ee; margin: 0 -16px; border-radius: 0; }
.hero-media > a img { display: block; width: 100%; aspect-ratio: 16 / 10; object-fit: cover; }
.hero-media.no-photo { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 130px; background: linear-gradient(135deg, #e8edf4, #dde4ee); }
.hero-media .ph { font-size: 48px; }
.hero-thumbs { position: absolute; right: 10px; bottom: 10px; display: flex; gap: 6px; }
.hero-thumbs a { position: relative; display: block; width: 58px; height: 44px; border-radius: 8px; overflow: hidden; border: 2px solid #fff; box-shadow: 0 2px 8px rgba(0, 0, 0, .25); }
.hero-thumbs img { width: 100%; height: 100%; object-fit: cover; }
.hero-thumbs .more { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(0, 0, 0, .55); color: #fff; font-weight: 700; font-size: 14px; }
.hero-info { margin: 0; display: flex; flex-direction: column; gap: 6px; }
.hero-info h1 { font-size: 22px; }
.hero-info .loc { white-space: normal; font-size: 14px; }
.status-form { margin: 2px 0; }
.status-pill { position: relative; display: inline-flex; align-items: center; border-radius: 20px; background: var(--ok-soft); color: var(--ok); }
.status-pill .dot { position: absolute; left: 12px; width: 8px; height: 8px; border-radius: 50%; background: currentColor; pointer-events: none; }
.status-pill select { width: auto; min-height: 34px; margin: 0; padding: 4px 32px 4px 26px; border: 0; border-radius: 20px; background-color: transparent; color: inherit; font-size: 14px; font-weight: 700; }
.status-pill.status-under-negotiation { background: var(--warn-soft); color: var(--warn); }
.status-pill.status-on-hold { background: #eceef2; color: #58606c; }
.status-pill.status-sold { background: var(--danger-soft); color: var(--danger); }
.status-pill.status-has-issue { background: #f3e9fd; color: #7422c4; }
.issue-field { margin-top: 10px; }
.issue-field textarea { margin-bottom: 8px; }
.issue-past { margin: 6px 0 0; font-size: 13px; }
.hero-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 6px; }
.hero-actions form { margin: 0; margin-left: auto; }
.desktop-only { display: none; }

.show-grid { display: flex; flex-direction: column; }
.col-main, .col-side { display: contents; }
.o-details { order: 1; } .o-pdf { order: 2; } .o-queries { order: 3; } .o-owner { order: 4; } .o-text { order: 5; } .o-media { order: 6; }
.pdf-pending-card { border: 2px dashed var(--warn); background: #fffbf3; }
.pdf-done { border-top: 4px solid var(--ok); }
.o-verify { order: 2; }
.verify-pending-card { border: 2px dashed var(--warn); background: #fffbf3; }
.verify-done { border-top: 4px solid #1d9bf0; }
.pill-verified { background: #e3f2fd; color: #1769aa; }

.details { margin: 0; display: grid; }
.details > div { display: grid; grid-template-columns: minmax(110px, 42%) minmax(0, 1fr); gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.details > div:last-child { border-bottom: 0; }
.details > div.wide { grid-template-columns: 1fr; gap: 2px; }
.details dt { color: var(--muted); font-size: 13.5px; }
.details dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
.contact-btns { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.prose { margin: 0; line-height: 1.6; }

.file-list { list-style: none; margin: 0 0 12px; padding: 0; }
.file-list li, .media-row { display: flex; align-items: center; gap: 8px; }
.file-list li { padding: 10px 0; border-bottom: 1px solid var(--line); }
.file-list li:last-child { border-bottom: 0; }
.file-list form, .media-row form { margin: 0; }
.file-ico { flex: none; width: 40px; height: 40px; display: grid; place-items: center; border-radius: 10px; background: var(--bg); font-size: 19px; }
.file-name { flex: 1; min-width: 0; font-weight: 600; text-decoration: none; color: var(--ink); overflow-wrap: anywhere; line-height: 1.3; }
a.file-ico { text-decoration: none; }
.btn-view { flex: none; background: var(--navy); border-color: var(--navy); color: #fff; }
.btn-view:hover { background: var(--navy-2); }
.file-name small { display: block; font-weight: 400; color: var(--muted); font-size: 12px; margin-top: 2px; }
a.file-name:hover { color: var(--navy-2); text-decoration: underline; }

.media-tabs { display: flex; gap: 6px; margin-bottom: 14px; overflow-x: auto; scrollbar-width: none; }
.media-tabs::-webkit-scrollbar { display: none; }
.media-tabs button { flex: 1 0 auto; display: inline-flex; align-items: center; justify-content: center; gap: 5px; min-height: 40px; padding: 0 12px; border: 1px solid var(--line); border-radius: 20px; background: #fff; font: inherit; font-size: 13.5px; font-weight: 600; color: var(--muted); cursor: pointer; white-space: nowrap; }
.media-tabs button b { font-size: 12px; color: var(--ink); }
.media-tabs button.active { background: var(--navy); border-color: var(--navy); color: #fff; }
.media-tabs button.active b { color: var(--gold); }
.gallery { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.gallery figure { position: relative; margin: 0; aspect-ratio: 1; border-radius: 10px; overflow: hidden; background: #e6eaf0; }
.gallery img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform .2s; }
.gallery a:hover img { transform: scale(1.04); }
.gallery form { position: absolute; top: 5px; right: 5px; margin: 0; }
.del { width: 28px; height: 28px; border: 0; border-radius: 50%; background: rgba(0, 0, 0, .55); color: #fff; cursor: pointer; font-size: 12px; }
.videos { display: grid; gap: 14px; }
.videos video { display: block; width: 100%; max-height: 360px; border-radius: 10px; background: #000; }
.media-item { margin-bottom: 12px; }
.media-item audio { display: block; width: 100%; height: 44px; }
.media-row { margin-top: 6px; }
.add-files { margin-top: 16px; border-top: 1px solid var(--line); padding-top: 12px; }
.add-files summary { cursor: pointer; font-weight: 700; color: var(--navy); padding: 8px 0; list-style: none; }
.add-files summary::-webkit-details-marker { display: none; }
.add-files[open] summary { margin-bottom: 10px; }

/* ---------- Add / edit form ---------- */
.form-head { margin-bottom: 14px; }
.form-head p { margin: 4px 0 0; font-size: 14px; }
.prop-form .card h2 { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 6px; margin-bottom: 14px; }
.prop-form .card h2 small { font-size: 12.5px; }
.savebar {
  position: sticky; bottom: 0; z-index: 30; display: flex; align-items: center; gap: 10px; margin: 0 -16px;
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); background: rgba(255, 255, 255, .96); backdrop-filter: blur(8px);
  border-top: 1px solid var(--line); box-shadow: 0 -6px 20px rgba(15, 42, 74, .07);
}
.savebar .btn-primary { flex: 1; }
.savebar .progress { position: absolute; left: 16px; right: 16px; top: -38px; flex: none; }
body.has-actionbar main.wrap:has(.savebar) { padding-bottom: 0; }
.new-type { padding: 14px; border-radius: 12px; background: var(--gold-soft); border: 1px solid #efdfb6; }
.new-type p { margin: 12px 0; font-size: 13.5px; }
.nf-head { display: none; }
.nf-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 38px; gap: 8px; align-items: center; padding: 10px; margin-bottom: 8px; background: #fff; border: 1px solid #efdfb6; border-radius: 10px; }
.nf-row input, .nf-row select { margin: 0; min-height: 42px; }
.nf-row input[name=nf_label] { grid-column: 1 / 3; }
.nf-row [data-remove-row] { grid-column: 3; grid-row: 1; }

.img-fallback { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; background: linear-gradient(135deg, #e8edf4, #dde4ee); color: var(--muted); font-size: 11.5px; font-weight: 700; letter-spacing: .5px; }
.img-fallback::before { content: "🖼️"; font-size: 24px; }
.gallery a, .hero-thumbs a, .hero-media > a { position: relative; display: block; height: 100%; }

.region-badge { display: inline-flex; align-items: center; gap: 4px; margin-top: 7px; padding: 3px 10px; border-radius: 12px; background: var(--gold-soft); border: 1px solid #efdfb6; color: #6d5316; font-size: 12.5px; font-weight: 700; }

/* ---------- Client queries ---------- */
.cq-intro { margin: -6px 0 12px; font-size: 13.5px; }
.cq-new > summary { list-style: none; width: 100%; }
.cq-new > summary::-webkit-details-marker, .cq-edit > summary::-webkit-details-marker { display: none; }
.cq-new[open] > summary { display: none; }
.cq-form { display: grid; gap: 12px; }
.cq-new .cq-form { padding: 14px; border-radius: 12px; background: var(--gold-soft); border: 1px solid #efdfb6; }
.cq-two { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
.cq-actions { display: flex; justify-content: flex-end; }
.cq-list { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 10px; }
.cq-item { padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line); background: #fff; }
.cq-item.open { border-left: 4px solid var(--warn); background: #fffbf3; }
.cq-item.answered { border-left: 4px solid var(--ok); }
.cq-item:target { outline: 3px solid rgba(201, 162, 74, .5); }
.cq-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.cq-date { font-size: 12.5px; }
.cq-q { margin: 8px 0 4px; font-weight: 600; line-height: 1.45; }
.cq-client { font-size: 13.5px; color: var(--muted); display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; }
.cq-wa { color: #128c4a; font-weight: 600; text-decoration: none; margin-left: 4px; }
.cq-answer { margin-top: 10px; padding: 10px 12px; border-radius: 10px; background: var(--ok-soft); }
.cq-answer-label { display: block; font-size: 12px; font-weight: 700; color: var(--ok); margin-bottom: 2px; }
.cq-answer p { margin: 0; line-height: 1.5; }
.cq-edit { margin-top: 8px; }
.cq-edit > summary { list-style: none; display: inline-block; cursor: pointer; font-size: 13.5px; font-weight: 700; color: var(--navy-2); padding: 4px 0; }
.cq-edit[open] > summary { margin-bottom: 8px; }
.cq-item.answered .cq-edit[open] { padding-top: 8px; border-top: 1px dashed var(--line); }
.cq-del { margin-top: 6px; }
@media (min-width: 600px) { .cq-two { grid-template-columns: 1fr 1fr; } }

/* ---------- Requirements ---------- */
.rq-form { display: grid; gap: 14px; }
.rq-editing { border: 2px solid var(--gold); }
.rq-actions { display: flex; justify-content: flex-end; gap: 10px; }
.rq-actions .btn-primary { flex: 1; }
.rq-list { display: grid; gap: 12px; }
.rq-item { margin: 0; display: flex; flex-direction: column; gap: 8px; }
.rq-item:target { outline: 3px solid rgba(201, 162, 74, .5); }
.rq-top { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; }
.rq-type { font-weight: 600; color: var(--navy); }
.rq-text { margin: 0; font-size: 15px; line-height: 1.55; }
.rq-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; padding-top: 10px; border-top: 1px solid var(--line); }
.rq-phone { font-weight: 700; color: var(--navy); text-decoration: none; font-size: 15px; }
.rq-btns { display: flex; align-items: center; gap: 6px; }
.rq-btns form { margin: 0; }
@media (min-width: 600px) {
  .rq-form { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); align-items: start; }
  .rq-form > label:first-child { grid-row: span 3; }
  .rq-actions { align-self: end; }
  .rq-list { grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 16px; }
}

/* ---------- PDF side panel ---------- */
.pdf-drawer {
  position: fixed; inset: 0; z-index: 90; background: #2b3038;
  transform: translateY(100%); transition: transform .25s ease;
}
body.pdf-open .pdf-drawer { transform: none; }
body.pdf-open { overflow: hidden; }
.pdf-drawer iframe { display: block; width: 100%; height: 100%; border: 0; }

/* ---------- Tablet (600px+) ---------- */
@media (min-width: 600px) {
  h1 { font-size: 26px; }
  .card { padding: 22px; }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 18px; }
  .span-2 { grid-column: 1 / -1; }
  .dz-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .cards { grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 18px; }
  .prop-card { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .thumb { min-height: 0; aspect-ratio: 16 / 10; }
  .thumb .ph { font-size: 52px; }
  .badges { left: 10px; top: 10px; right: 10px; }
  .status { font-size: 11.5px; padding: 3px 9px; }
  .prop-card .body { padding: 14px 16px 14px; gap: 5px; }
  .prop-card h3 { font-size: 16px; }
  .price { font-size: 19px; }
  .highlights { display: flex; }
  .card-foot { border-top: 1px solid var(--line); padding-top: 10px; margin-top: 8px; }
  .search-btn { display: inline-flex; min-height: 48px; border-radius: 12px; }
  .chip-row { margin: 0 0 14px; padding: 0; flex-wrap: wrap; }
  .gallery { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
  .gallery figure { aspect-ratio: 4 / 3; }
  .del { opacity: 0; transition: opacity .15s; }
  .gallery figure:hover .del, .del:focus { opacity: 1; }
  .hero-media { margin: 0; border-radius: var(--radius); }
  .nf-head { display: grid; grid-template-columns: 2fr 120px 1fr 1.4fr 38px; gap: 8px; font-size: 12.5px; font-weight: 600; color: var(--muted); margin-bottom: 6px; padding: 0 2px; }
  .nf-row { grid-template-columns: 2fr 120px 1fr 1.4fr 38px; padding: 0; background: none; border: 0; }
  .nf-row input[name=nf_label], .nf-row [data-remove-row] { grid-column: auto; grid-row: auto; }
  .savebar { margin: 0; border-radius: var(--radius) var(--radius) 0 0; justify-content: flex-end; }
  .savebar .btn-primary { flex: none; min-width: 220px; }
  .savebar .progress { position: static; flex: 1; }
  .videos { grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }
}

/* ---------- Desktop (900px+) ---------- */
@media (min-width: 900px) {
  :root { --bottom-h: 0px; }
  main.wrap { padding-top: 24px; padding-bottom: 48px; }
  body.has-bottomnav main.wrap, body.has-actionbar main.wrap { padding-bottom: 48px; }
  .topbar-inner { height: 64px; }
  .brand { font-size: 19px; }
  .topnav { display: flex; }
  .top-add, .top-logout, .bottomnav, .actionbar, .filter-toggle, .fp-head, .fp-backdrop { display: none !important; }
  .desktop-only { display: inline-flex; }
  .toast { top: 80px; }

  .list-layout { display: grid; grid-template-columns: 270px minmax(0, 1fr); gap: 22px; align-items: start; }
  .filter-panel {
    position: sticky; top: 84px; z-index: 1; max-height: calc(100vh - 100px); transform: none; visibility: visible;
    border-radius: var(--radius); border: 1px solid var(--line); box-shadow: var(--shadow);
  }
  .filter-panel::before { content: "Filters"; display: block; padding: 16px 18px 0; font-weight: 700; font-size: 16px; color: var(--navy); }
  .fp-body { padding: 14px 18px; }
  .fp-foot { padding: 12px 18px 16px; }
  .searchbar { max-width: none; }

  .hero { grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 20px; align-items: stretch; }
  .hero-media { height: 400px; }
  .hero-media > a { display: block; height: 100%; }
  .hero-media > a img { height: 100%; aspect-ratio: auto; }
  .hero-media.no-photo { height: auto; min-height: 100%; }
  .hero-info { padding: 26px; justify-content: center; }
  .hero-info h1 { font-size: 28px; }
  .price.big { font-size: 30px; }
  .show-grid { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 20px; align-items: start; }
  .col-main, .col-side { display: block; }
  .savebar { bottom: 12px; border-radius: var(--radius); border: 1px solid var(--line); }
}

/* Desktop: PDF on the right, property details stay readable on the left */
@media (min-width: 900px) {
  :root { --pdf-w: min(760px, 52vw); }
  .pdf-drawer { left: auto; width: var(--pdf-w); transform: translateX(100%); box-shadow: -12px 0 40px rgba(10, 20, 35, .25); }
  body.pdf-open { overflow: auto; }
  body.pdf-open main.wrap { max-width: none; margin: 0; width: calc(100% - var(--pdf-w)); padding-left: 24px; padding-right: 24px; }
  body.pdf-open .topbar-inner { max-width: none; width: calc(100% - var(--pdf-w)); margin: 0; padding-left: 24px; }
  body.pdf-open .topnav a:not(.btn) { display: none; }
  body.pdf-open .hero, body.pdf-open .show-grid { grid-template-columns: minmax(0, 1fr); }
  body.pdf-open .hero-media { height: 260px; }
  main.wrap, .topbar-inner { transition: width .25s ease; }
}

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

/* Login */
.login-page { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; background: linear-gradient(160deg, var(--navy) 0%, var(--navy-2) 100%); }
.login-card { width: 100%; max-width: 380px; background: #fff; border-radius: 18px; padding: 28px 24px; box-shadow: 0 20px 60px rgba(0, 0, 0, .3); }
.login-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 22px; }
.login-brand .mark { width: 44px; height: 44px; border-radius: 11px; background: var(--gold); color: var(--navy); display: grid; place-items: center; font-weight: 800; font-size: 22px; }
.login-brand h1 { margin: 0; font-size: 20px; color: var(--navy); }
.login-brand p { margin: 2px 0 0; }
.login-card form { display: flex; flex-direction: column; gap: 14px; }
.login-card .btn { width: 100%; }
