/* ---------- Design tokens: change these to re-skin the whole site ---------- */
:root {
  --ink: #0F2230;
  --lake: #0F5C63;
  --lake-dark: #0B464C;
  --lake-tint: #E3F0F0;
  --amber-tint: #FBEFD5;
  --amber-text: #7A4E0C;
  --slate-tint: #E6EAF2;
  --slate-text: #33415C;
  --surface: #F4F7F8;
  --line: #DAE2E6;
  --text: #1A2A34;
  --muted: #566871;
  --white: #fff;

  --font-display: "Bricolage Grotesque", "Segoe UI", system-ui, sans-serif;
  --font-body: "Manrope", "Segoe UI", system-ui, sans-serif;

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 22px;
  --shadow: 0 1px 2px rgba(15, 34, 48, .06), 0 8px 24px rgba(15, 34, 48, .08);
  --container: 1180px;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; font-family: var(--font-body); color: var(--text);
  background: var(--white); line-height: 1.6; -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { font-family: var(--font-display); color: var(--ink); line-height: 1.15; margin: 0 0 .5em; letter-spacing: -.02em; }
h1 { font-size: clamp(2.2rem, 5vw, 3.8rem); }
h2 { font-size: clamp(1.6rem, 3vw, 2.2rem); }
h3 { font-size: 1.1rem; }
p { margin: 0 0 1em; }
a { color: inherit; }
ul { margin: 0; padding: 0; list-style: none; }
img, svg { max-width: 100%; }
.container { width: min(100% - 2.5rem, var(--container)); margin-inline: auto; }
:focus-visible { outline: 3px solid #2B8AF7; outline-offset: 2px; }
.skip-link { position: absolute; left: -999px; top: 8px; background: var(--ink); color: #fff; padding: .6rem 1rem; border-radius: var(--radius-sm); z-index: 100; }
.skip-link:focus { left: 8px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  font: 600 .95rem var(--font-body); padding: .65rem 1.1rem; border-radius: var(--radius-sm);
  border: 1px solid transparent; cursor: pointer; text-decoration: none;
  transition: background-color .15s, border-color .15s, color .15s;
}
.btn-primary { background: var(--lake); color: #fff; }
.btn-primary:hover { background: var(--lake-dark); }
.btn-ghost { color: var(--ink); border-color: var(--line); background: var(--white); }
.btn-ghost:hover { border-color: var(--ink); }
.btn-lg { padding: .95rem 1.4rem; font-size: 1rem; }
.text-link { font-weight: 600; color: var(--lake); text-decoration: underline; text-underline-offset: 4px; }

/* ---------- Header ---------- */
.site-header { position: sticky; top: 0; z-index: 50; background: rgba(255,255,255,.92); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.nav { display: flex; align-items: center; height: 68px; gap: 1.5rem; }
.brand { display: inline-flex; align-items: center; gap: .5rem; font: 700 1.35rem var(--font-display); color: var(--lake); text-decoration: none; letter-spacing: -.02em; }
.nav-links { display: flex; align-items: center; gap: 1.4rem; flex: 1; }
.nav-links > a:not(.btn) { text-decoration: none; font-weight: 500; color: var(--muted); }
.nav-links > a:not(.btn):hover { color: var(--ink); }
.nav-spacer { flex: 1; }
.nav-toggle { display: none; margin-left: auto; background: none; border: 0; padding: .5rem; cursor: pointer; }
.nav-toggle span { display: block; width: 22px; height: 2px; background: var(--ink); margin: 5px 0; }

/* ---------- Hero and search ---------- */
.hero { background: var(--ink); color: #fff; padding: clamp(3rem, 8vw, 6rem) 0 clamp(3rem, 6vw, 4.5rem); }
.hero h1 { color: #fff; max-width: 15ch; }
.hero-sub { color: #B9CBD4; font-size: 1.15rem; max-width: 52ch; margin-bottom: 2.2rem; }

.search { background: var(--white); color: var(--text); border-radius: var(--radius-lg); padding: 1.1rem; box-shadow: var(--shadow); max-width: 980px; }
.segmented { display: inline-flex; background: var(--surface); border-radius: var(--radius-sm); padding: 4px; margin-bottom: 1rem; }
.segmented label { cursor: pointer; }
.segmented input { position: absolute; opacity: 0; pointer-events: none; }
.segmented span { display: block; padding: .45rem 1.3rem; border-radius: 6px; font-weight: 600; color: var(--muted); transition: background-color .15s, color .15s; }
.segmented input:checked + span { background: var(--white); color: var(--lake); box-shadow: 0 1px 3px rgba(15,34,48,.15); }
.segmented input:focus-visible + span { outline: 3px solid #2B8AF7; }

.search-fields { display: grid; grid-template-columns: 2fr 1fr 1fr auto; gap: .75rem; align-items: end; }
.field label { display: block; font-size: .85rem; font-weight: 600; color: var(--muted); margin-bottom: .3rem; }
input[type=text], input[type=number], input[type=email], input[type=password], input[type=tel], select {
  width: 100%; font: 500 1rem var(--font-body); color: var(--text);
  padding: .8rem .9rem; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--white);
}
input::placeholder { color: #8A9AA2; }
input:hover, select:hover { border-color: #AEBDC4; }

/* ---------- Sections ---------- */
.section { padding: clamp(2.5rem, 6vw, 4.5rem) 0; }
.section-tint { background: var(--surface); }
.section-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 1.5rem; }
.lead { color: var(--muted); font-size: 1.1rem; max-width: 52ch; }
.split { display: grid; grid-template-columns: 1.2fr 1fr; gap: 3rem; align-items: center; }
.checks li { position: relative; padding: .9rem 0 .9rem 2rem; border-bottom: 1px solid var(--line); font-weight: 500; }
.checks li::before { content: ""; position: absolute; left: 0; top: 1.25rem; width: 14px; height: 8px; border-left: 2.5px solid var(--lake); border-bottom: 2.5px solid var(--lake); transform: rotate(-45deg); }

/* ---------- Property cards ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 1.5rem; }
.card { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius-md); overflow: hidden; transition: box-shadow .2s, border-color .2s; }
.card:hover { box-shadow: var(--shadow); border-color: transparent; }
.card-media { display: block; position: relative; aspect-ratio: 4 / 3; }
/* Placeholder visuals; real photos replace these in the media step */
.tone-1 { background: linear-gradient(135deg, #9CC5C3, #3E8A8C); }
.tone-2 { background: linear-gradient(135deg, #C9D6A8, #7A9A5B); }
.tone-3 { background: linear-gradient(135deg, #B9C6E0, #6F86B5); }
.tone-4 { background: linear-gradient(135deg, #CFCFC6, #8D8F86); }
.tone-5 { background: linear-gradient(135deg, #E1CFA5, #B8955A); }
.tone-6 { background: linear-gradient(135deg, #A9CDE0, #4F87A8); }
.card-media::after { content: ""; position: absolute; inset: auto 0 0 0; height: 45%;
  background: linear-gradient(to top, rgba(15,34,48,.35), transparent); }
.badge { position: absolute; top: .8rem; left: .8rem; z-index: 1; font-size: .8rem; font-weight: 700; padding: .25rem .65rem; border-radius: 999px; }
.badge-sale { background: var(--lake-tint); color: var(--lake-dark); }
.badge-rent { background: var(--amber-tint); color: var(--amber-text); }
.badge-lease { background: var(--slate-tint); color: var(--slate-text); }
.card-body { padding: 1.1rem 1.2rem 1.3rem; }
.card-price { font: 700 1.35rem var(--font-display); color: var(--ink); margin-bottom: .2rem; }
.card-price .per { font: 500 .9rem var(--font-body); color: var(--muted); }
.card-title { margin-bottom: .1rem; }
.card-area { color: var(--muted); font-size: .95rem; margin-bottom: .8rem; }
.card-meta { display: flex; gap: 1rem; padding-top: .8rem; border-top: 1px solid var(--line); font-size: .9rem; font-weight: 600; color: var(--text); }

/* ---------- Listings page ---------- */
.page-head { background: var(--surface); border-bottom: 1px solid var(--line); padding: 2rem 0 1.5rem; }
.page-head h1 { font-size: clamp(1.8rem, 3vw, 2.4rem); }
.filters { display: grid; grid-template-columns: repeat(4, 1fr) auto; gap: .75rem; }
.result-count { color: var(--muted); font-weight: 600; margin-bottom: 1.2rem; }
.empty { text-align: center; padding: 3rem 1rem; }
.empty p { color: var(--muted); }

/* ---------- Footer ---------- */
.site-footer { background: var(--ink); color: #B9CBD4; padding-top: 3.5rem; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 2rem; padding-bottom: 2.5rem; }
.footer-brand { font: 700 1.4rem var(--font-display); color: #fff; margin-bottom: .4rem; }
.footer-note { max-width: 36ch; }
.footer-title { color: #fff; font-weight: 700; margin-bottom: .6rem; }
.site-footer a { display: block; text-decoration: none; padding: .2rem 0; }
.site-footer a:hover { color: #fff; text-decoration: underline; }
.footer-base { border-top: 1px solid rgba(255,255,255,.12); padding: 1.2rem 0; font-size: .9rem; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .search-fields { grid-template-columns: 1fr 1fr; }
  .field-grow, .search-fields .btn { grid-column: 1 / -1; }
  .filters { grid-template-columns: 1fr 1fr; }
  .split, .footer-grid { grid-template-columns: 1fr; gap: 1.5rem; }
}
@media (max-width: 760px) {
  .nav-toggle { display: block; }
  .nav-links { display: none; position: absolute; top: 68px; left: 0; right: 0; flex-direction: column; align-items: stretch;
    gap: 0; background: var(--white); border-bottom: 1px solid var(--line); padding: .5rem 1.25rem 1.25rem; }
  .nav-links.open { display: flex; }
  .nav-links > a:not(.btn) { padding: .8rem 0; border-bottom: 1px solid var(--line); }
  .nav-spacer { display: none; }
  .nav-links .btn { margin-top: .75rem; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; scroll-behavior: auto !important; }
}

/* ---------- Flash messages ---------- */
.flashes { padding-top: 1rem; display: grid; gap: .5rem; }
.flash { margin: 0; padding: .8rem 1rem; border-radius: var(--radius-sm); font-weight: 600; border: 1px solid; }
.flash-success { background: #E4F4EA; color: #14532D; border-color: #B7E0C6; }
.flash-error   { background: #FCE8E6; color: #8A1C12; border-color: #F3B9B3; }
.flash-info    { background: var(--lake-tint); color: var(--lake-dark); border-color: #BBD9DA; }

/* ---------- Auth ---------- */
.auth { padding: clamp(2rem, 6vw, 4rem) 0; background: var(--surface); min-height: 70vh; }
.auth-card { width: min(100% - 2.5rem, 460px); margin: 0 auto; background: var(--white);
  border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 2rem; box-shadow: var(--shadow); }
.auth-card h1 { font-size: 1.8rem; }
.auth-card .sub { color: var(--muted); margin-bottom: 1.5rem; }
.stack { display: grid; gap: 1rem; }
.stack .btn { width: 100%; }
.auth-switch { margin: 1.25rem 0 0; text-align: center; color: var(--muted); }

.field.has-error input, .field.has-error select { border-color: #C0392B; }
.field-msg { font-size: .85rem; color: var(--muted); margin: .3rem 0 0; }
.field-msg.error { color: #A52A1F; font-weight: 600; }
.check { display: flex; align-items: center; gap: .5rem; font-weight: 500; }
.check input { width: 1.1rem; height: 1.1rem; accent-color: var(--lake); }

/* ---------- Dashboard ---------- */
.dash-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 1.5rem; }
.panel { border: 1px solid var(--line); border-radius: var(--radius-md); padding: 1.5rem; }
.panel h2 { font-size: 1.25rem; }
.details { margin: 0; }
.details div { display: flex; justify-content: space-between; gap: 1rem; padding: .6rem 0; border-bottom: 1px solid var(--line); }
.details dt { color: var(--muted); }
.details dd { margin: 0; font-weight: 600; text-align: right; }
.stat { font: 700 2.6rem var(--font-display); color: var(--ink); margin: 0 0 .25rem; }

.chip { display: inline-block; font-size: .8rem; font-weight: 700; padding: .15rem .6rem;
  border-radius: 999px; margin-left: .4rem; background: var(--surface); color: var(--text); }
.chip-admin { background: var(--slate-tint); color: var(--slate-text); }
.chip-agent { background: var(--lake-tint); color: var(--lake-dark); }
.chip-landlord { background: var(--amber-tint); color: var(--amber-text); }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius-md); }
.table { width: 100%; border-collapse: collapse; min-width: 640px; }
.table th, .table td { text-align: left; padding: .8rem 1rem; border-bottom: 1px solid var(--line); }
.table th { background: var(--surface); font-size: .9rem; color: var(--muted); }
.table tr:last-child td { border-bottom: 0; }
.table .chip { margin-left: 0; }

/* ---------- Navbar form (logout) ---------- */
.nav-form { margin: 0; }
@media (max-width: 760px) {
  .nav-links .nav-form .btn { width: 100%; margin-top: .75rem; }
}

/* ---------- Step 5: listings management and detail ---------- */
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.plain-link { text-decoration: none; color: inherit; }
.plain-link:hover { text-decoration: underline; }
.block { display: flex; width: 100%; }

textarea {
  width: 100%; min-height: 150px; resize: vertical; font: 500 1rem var(--font-body); color: var(--text);
  padding: .8rem .9rem; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--white);
}
.btn-sm { padding: .4rem .8rem; font-size: .875rem; }
.btn-danger { background: var(--white); color: #A52A1F; border-color: #E8B4AE; }
.btn-danger:hover { background: #FCE8E6; }

.head-row { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; flex-wrap: wrap; }
.actions { display: flex; gap: .5rem; flex-wrap: wrap; }

/* Forms */
.form-layout { max-width: 820px; display: grid; gap: 1.5rem; }
.form-card { gap: 1.5rem; }
.group { border: 1px solid var(--line); border-radius: var(--radius-md); padding: 1.25rem 1.25rem 1.5rem; margin: 0; display: grid; gap: 1rem; }
.group legend { font: 700 1.05rem var(--font-display); color: var(--ink); padding: 0 .5rem; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
.amenity-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: .6rem 1rem; }
.form-actions { display: flex; gap: .75rem; align-items: center; flex-wrap: wrap; }
.form-actions .btn { width: auto; }
.danger-zone h2 { font-size: 1.1rem; margin: 0; }

/* Table cells */
.cell-title a { font-weight: 700; color: var(--ink); text-decoration: none; }
.cell-title a:hover { text-decoration: underline; }
.cell-sub { color: var(--muted); font-size: .88rem; }
.inline-form { display: flex; gap: .4rem; align-items: center; margin: .5rem 0 0; }
.inline-form select { width: auto; padding: .4rem .6rem; font-size: .9rem; }
.table .chip { margin-left: 0; }

/* Status chips */
.status-draft { background: var(--surface); color: var(--muted); }
.status-active { background: #E4F4EA; color: #14532D; }
.status-under_offer { background: var(--amber-tint); color: var(--amber-text); }
.status-sold, .status-let { background: var(--slate-tint); color: var(--slate-text); }
.status-archived { background: #ECECEC; color: #555; }

/* Detail page */
.manage-bar { background: var(--lake-tint); border-bottom: 1px solid #BBD9DA; }
.manage-row { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: .6rem 0; }
.manage-row p { margin: 0; font-weight: 600; color: var(--lake-dark); }
.notice { margin: 1rem 0 0; padding: .8rem 1rem; border-radius: var(--radius-sm); background: var(--amber-tint); color: var(--amber-text); font-weight: 600; }
.detail { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 2.5rem; align-items: start; margin-top: 1.25rem; }
.detail-media { position: relative; aspect-ratio: 16 / 9; border-radius: var(--radius-lg); overflow: hidden; }
.detail-title { margin-top: 1.5rem; margin-bottom: .2rem; }
.facts { display: flex; flex-wrap: wrap; gap: .75rem 1.75rem; padding: 1rem 0; margin: 1.25rem 0 1.75rem; border-block: 1px solid var(--line); }
.facts strong { font-family: var(--font-display); font-size: 1.2rem; color: var(--ink); }
.prose { white-space: pre-line; max-width: 68ch; }
.tags { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 1.5rem; }
.tags li { background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: .3rem .8rem; font-weight: 600; font-size: .9rem; }
.aside-card { position: sticky; top: 90px; border: 1px solid var(--line); border-radius: var(--radius-md); padding: 1.5rem; box-shadow: var(--shadow); }
.price-big { font: 700 1.9rem var(--font-display); color: var(--ink); margin-bottom: .5rem; }
.price-big .per { font: 500 1rem var(--font-body); color: var(--muted); }
.contact-name { color: var(--muted); font-weight: 600; }

@media (max-width: 900px) {
  .detail { grid-template-columns: 1fr; }
  .aside-card { position: static; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
}

/* ---------- Step 6: media ---------- */
.card-media img, .detail-media img {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
}
.form-layout.wide { max-width: 980px; }
.group h2 { font-size: 1.15rem; margin: 0; }

input[type=file] {
  width: 100%; padding: .8rem; font: 500 .95rem var(--font-body);
  border: 1px dashed #AEBDC4; border-radius: var(--radius-sm); background: var(--surface);
}

/* Management tiles */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 1rem; }
.tile { border: 1px solid var(--line); border-radius: var(--radius-md); overflow: hidden; background: var(--white); }
.tile-img { position: relative; aspect-ratio: 4 / 3; background: var(--surface); }
.tile-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tile-actions { display: flex; flex-wrap: wrap; gap: .4rem; padding: .6rem; }
.tile-actions .inline-form { margin: 0; }

.docs li { padding: .6rem 0; border-bottom: 1px solid var(--line); }
.doc-row { display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
.doc-row .inline-form { margin: 0; }
.docs a { font-weight: 600; color: var(--lake); }

/* Detail gallery */
.thumbs { display: flex; gap: .5rem; margin-top: .6rem; overflow-x: auto; padding-bottom: .25rem; }
.thumb { padding: 0; border: 2px solid transparent; border-radius: var(--radius-sm); overflow: hidden;
  background: none; cursor: pointer; width: 92px; aspect-ratio: 4 / 3; flex: none; opacity: .75; }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb:hover { opacity: 1; }
.thumb.active { border-color: var(--lake); opacity: 1; }

.plans { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1rem; margin-bottom: 1.5rem; }
.plans img { width: 100%; background: var(--white); border: 1px solid var(--line); border-radius: var(--radius-md); }
.tour { position: relative; aspect-ratio: 16 / 9; border-radius: var(--radius-md); overflow: hidden; margin-bottom: 1.5rem; background: var(--surface); }
.tour iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

/* ---------- Step 7: search, favourites, saved searches ---------- */
.card { position: relative; }

.search-layout { display: grid; grid-template-columns: 290px minmax(0, 1fr); gap: 2rem; align-items: start; }
.filter-panel {
  position: sticky; top: 88px; max-height: calc(100vh - 108px); overflow-y: auto;
  border: 1px solid var(--line); border-radius: var(--radius-md); padding: 1.1rem; background: var(--white);
}
.filter-summary { display: none; cursor: pointer; font-weight: 700; list-style: none; align-items: center; justify-content: space-between; gap: .5rem; }
.filter-summary::-webkit-details-marker { display: none; }
.filter-form { display: grid; gap: 1rem; }
.filter-form fieldset { border: 0; padding: 0; margin: 0; display: grid; gap: .5rem; min-width: 0; }
.filter-form legend { font-size: .85rem; font-weight: 600; color: var(--muted); margin-bottom: .35rem; padding: 0; }
.price-row { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; }
.amenity-list { display: grid; gap: .45rem; }
.filter-actions { display: flex; gap: 1rem; align-items: center; }
.save-search { margin-top: 1.25rem; padding-top: 1.25rem; border-top: 1px solid var(--line); }
.save-search .stack .btn { width: auto; justify-self: start; }

.results-bar { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.2rem; }
.results-bar .result-count { margin: 0; }
.sort-form { display: flex; align-items: center; gap: .5rem; margin: 0; }
.sort-form label { font-weight: 600; color: var(--muted); font-size: .9rem; }
.sort-form select { width: auto; }

.pager { display: flex; justify-content: center; align-items: center; gap: .35rem; margin-top: 2rem; flex-wrap: wrap; }
.pager-link {
  min-width: 40px; height: 40px; padding: 0 .8rem; display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--line); border-radius: var(--radius-sm); text-decoration: none; font-weight: 600; color: var(--ink);
}
.pager-link:hover { border-color: var(--ink); }
.pager-link.current { background: var(--lake); border-color: var(--lake); color: #fff; }
.pager-gap { padding: 0 .3rem; color: var(--muted); }

/* Hearts */
.fav-form { position: absolute; top: .7rem; right: .7rem; z-index: 2; margin: 0; }
.fav-form form { margin: 0; }
.fav {
  display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px;
  border-radius: 50%; border: 0; background: rgba(255, 255, 255, .95); color: var(--ink);
  cursor: pointer; text-decoration: none; box-shadow: 0 1px 4px rgba(15, 34, 48, .25);
}
.fav:hover { color: #C0392B; }
.fav svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.fav.is-saved svg { fill: #C0392B; stroke: #C0392B; }
.fav-form.fav-wide { position: static; margin: .75rem 0 0; }
.fav-wide .fav {
  width: 100%; height: auto; border-radius: var(--radius-sm); padding: .65rem 1rem; gap: .5rem;
  border: 1px solid var(--line); box-shadow: none; background: var(--white); font: 600 .95rem var(--font-body);
}

/* Saved pages */
.tabs { display: flex; gap: 1.5rem; margin-top: .75rem; }
.tab { padding: .4rem 0; text-decoration: none; font-weight: 600; color: var(--muted); border-bottom: 2px solid transparent; }
.tab:hover { color: var(--ink); }
.tab.current { color: var(--ink); border-color: var(--lake); }
.saved-list { display: grid; gap: .75rem; }
.saved-list li {
  display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap;
  border: 1px solid var(--line); border-radius: var(--radius-md); padding: 1rem 1.25rem;
}
.saved-name { margin: 0; font-weight: 700; color: var(--ink); }
.saved-list .cell-sub { margin: 0; }
.saved-list .inline-form { margin: 0; }

@media (max-width: 900px) {
  .search-layout { grid-template-columns: 1fr; }
  .filter-panel { position: static; max-height: none; }
  .filter-summary { display: flex; }
  .filter-panel[open] .filter-summary { margin-bottom: 1rem; }
}

/* ---------- Step 8: enquiries and viewings ---------- */
.nav-badge {
  display: inline-block; min-width: 20px; padding: 0 .4rem; border-radius: 999px; text-align: center;
  background: #C0392B; color: #fff; font-size: .75rem; font-weight: 700; line-height: 20px; margin-left: .25rem;
}
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--lake); margin-right: .45rem; }

.inbox-list { display: grid; gap: .75rem; }
.inbox-item {
  display: flex; justify-content: space-between; gap: 1.25rem; padding: 1rem 1.25rem;
  border: 1px solid var(--line); border-radius: var(--radius-md); text-decoration: none; color: inherit;
  transition: border-color .15s, box-shadow .15s;
}
.inbox-item:hover { border-color: var(--lake); box-shadow: var(--shadow); }
.inbox-item.unread { background: var(--lake-tint); border-color: #BBD9DA; }
.inbox-title { margin: 0; font-weight: 700; color: var(--ink); }
.inbox-item .cell-sub { margin: 0; }
.inbox-preview { margin: .35rem 0 0; color: var(--muted); }
.inbox-side { text-align: right; flex: none; }
.inbox-side .chip { margin-left: 0; }

.thread-layout { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 2rem; align-items: start; }
.side-stack { display: grid; gap: 1.25rem; }
.notice-soft {
  margin: 0 0 1rem; padding: .75rem 1rem; border-radius: var(--radius-sm);
  background: var(--surface); border: 1px solid var(--line); color: var(--muted); font-size: .92rem;
}
.messages { display: grid; gap: .75rem; margin-bottom: 1.5rem; }
.msg {
  max-width: 85%; padding: .75rem 1rem; border-radius: var(--radius-md);
  background: var(--surface); border: 1px solid var(--line); white-space: pre-line; overflow-wrap: anywhere;
}
.msg.mine { justify-self: end; background: var(--lake-tint); border-color: #BBD9DA; }
.msg-meta { margin: 0 0 .2rem; font-size: .8rem; color: var(--muted); white-space: normal; }

.viewing { padding: .8rem 0; border-bottom: 1px solid var(--line); }
.viewing-time { margin: 0 0 .3rem; font-weight: 700; color: var(--ink); }
.viewing .actions { margin-top: .6rem; }
.viewing .inline-form { margin: 0; }
.viewing-form { margin-top: 1rem; }
.viewing-form .btn { width: auto; justify-self: start; }
input[type=datetime-local] {
  width: 100%; font: 500 1rem var(--font-body); color: var(--text);
  padding: .8rem .9rem; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--white);
}

.reveal { background: #E4F4EA; border: 1px solid #B7E0C6; border-radius: var(--radius-md); padding: 1rem 1.1rem; margin-top: .9rem; }
.panel.reveal { margin-top: 0; }
.reveal h2, .reveal-title { margin: 0 0 .5rem; font: 700 1rem var(--font-display); color: #14532D; }
.reveal p { margin: 0 0 .6rem; color: #14532D; }
.reveal a { font-weight: 700; color: #14532D; }

@media (max-width: 900px) {
  .thread-layout { grid-template-columns: 1fr; }
  .inbox-item { flex-direction: column; }
  .inbox-side { text-align: left; }
}


/* ---------- Step 9: verification, private listings, review ---------- */
.card-tags { display: flex; flex-wrap: wrap; gap: .4rem; margin: 0 0 .5rem; }
.vtag {
  display: inline-block; padding: .12rem .6rem; border-radius: 999px;
  font-size: .78rem; font-weight: 700; line-height: 1.5; border: 1px solid transparent;
}
.vtag-ok { background: #E4F4EA; color: #14532D; border-color: #B7E0C6; }
.vtag-no { background: var(--amber-tint); color: var(--amber-text); border-color: #EBD3A0; }
.vtag-private { background: var(--ink); color: #fff; }

.vpanel { border-radius: var(--radius-md); padding: 1rem 1.2rem; margin: 1.25rem 0 0; border: 1px solid; }
.vpanel p { margin: 0 0 .4rem; }
.vpanel-title { font: 700 1.05rem var(--font-display); }
.vpanel ul { display: grid; gap: .25rem; margin-bottom: .5rem; }
.vpanel ul li { position: relative; padding-left: 1.4rem; }
.vpanel ul li::before {
  content: ""; position: absolute; left: .15rem; top: .45em; width: 10px; height: 6px;
  border-left: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(-45deg);
}
.vpanel-ok { background: #E4F4EA; border-color: #B7E0C6; color: #14532D; }
.vpanel-no { background: var(--amber-tint); border-color: #EBD3A0; color: var(--amber-text); }

.teaser { max-width: 640px; }
.teaser h1 { margin-top: .75rem; }
.access-note { margin-bottom: 1.25rem; }
.wide-card { width: min(100% - 2.5rem, 560px); }

.card-media.locked { display: flex; align-items: center; justify-content: center; text-decoration: none; }
.lock-text { position: relative; z-index: 1; color: #fff; font-weight: 700; text-shadow: 0 1px 6px rgba(15, 34, 48, .5); }

.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1rem; margin-bottom: 1.5rem; }
.stat-row .stat { font-size: 2rem; margin: 0; }
.stat-row .panel { padding: 1.1rem 1.25rem; }
.check-list { display: grid; gap: .7rem; }
form.group h2, form.group legend { margin: 0; }


/* ---------- Live chat widget ---------- */
.chat {
  position: fixed; right: 1rem; bottom: calc(1rem + env(safe-area-inset-bottom, 0px));
  z-index: 60; font-family: var(--font-body);
}
.chat-launch {
  position: relative; display: inline-flex; align-items: center; gap: .55rem;
  padding: .8rem 1.2rem; border: 0; border-radius: 999px; cursor: pointer;
  background: var(--lake); color: #fff; font: 700 .95rem var(--font-body);
  box-shadow: 0 6px 20px rgba(15, 34, 48, .28); transition: background-color .15s;
}
.chat-launch:hover { background: var(--lake-dark); }
.chat-launch svg { width: 22px; height: 22px; flex: none; }
.chat-badge {
  position: absolute; top: -6px; right: -4px; min-width: 22px; height: 22px; padding: 0 .35rem;
  border-radius: 999px; background: #C0392B; color: #fff; border: 2px solid #fff;
  font-size: .75rem; font-weight: 700; line-height: 18px; text-align: center;
}
.chat.has-unread .chat-launch { animation: chat-pulse 2.2s ease-in-out infinite; }
@keyframes chat-pulse {
  0%, 100% { box-shadow: 0 6px 20px rgba(15, 34, 48, .28), 0 0 0 0 rgba(15, 92, 99, .45); }
  50% { box-shadow: 0 6px 20px rgba(15, 34, 48, .28), 0 0 0 10px rgba(15, 92, 99, 0); }
}

.chat-panel {
  position: absolute; right: 0; bottom: calc(100% + .75rem);
  width: min(380px, calc(100vw - 2rem)); height: min(560px, calc(100vh - 7rem));
  display: flex; flex-direction: column; overflow: hidden;
  background: var(--white); border: 1px solid var(--line); border-radius: var(--radius-lg);
  box-shadow: 0 18px 50px rgba(15, 34, 48, .3);
}
.chat-head {
  display: flex; justify-content: space-between; align-items: flex-start; gap: .75rem;
  padding: 1rem 1.1rem; background: var(--ink); color: #fff;
}
.chat-title { margin: 0; font: 700 1.1rem var(--font-display); }
.chat-status { display: flex; align-items: center; gap: .45rem; margin: .2rem 0 0; font-size: .82rem; color: #B9CBD4; }
.chat-dot { flex: none; width: 8px; height: 8px; border-radius: 50%; background: #8A9AA2; }
.chat-dot.on { background: #3DDC84; }
.chat-head-actions { display: flex; align-items: center; gap: .6rem; flex: none; }
.chat-link { background: none; border: 0; padding: 0; color: #B9CBD4; font: 600 .85rem var(--font-body); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.chat-link:hover { color: #fff; }
.chat-x { display: grid; place-items: center; width: 32px; height: 32px; border: 0; border-radius: 50%; background: rgba(255, 255, 255, .12); color: #fff; cursor: pointer; }
.chat-x:hover { background: rgba(255, 255, 255, .22); }
.chat-x svg { width: 16px; height: 16px; }
.chat :focus-visible { outline-color: #2B8AF7; }

.chat-body { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.chat-error { margin: 0; padding: .6rem 1.1rem; background: #FCE8E6; color: #8A1C12; font-size: .88rem; font-weight: 600; }

.chat-start { padding: 1rem 1.1rem 1.1rem; overflow-y: auto; display: grid; gap: .85rem; align-content: start; }
.chat-hello { margin: 0; font-weight: 600; color: var(--ink); }
.chat-chips { display: flex; flex-wrap: wrap; gap: .4rem; }
.chat-chip {
  padding: .35rem .8rem; border: 1px solid var(--line); border-radius: 999px; background: var(--white);
  color: var(--ink); font: 600 .83rem var(--font-body); cursor: pointer;
}
.chat-chip:hover { border-color: var(--lake); color: var(--lake-dark); }
.chat-field label { display: block; margin-bottom: .25rem; font-size: .82rem; font-weight: 600; color: var(--muted); }
.chat .chat-field input, .chat textarea { padding: .6rem .75rem; font-size: .95rem; }
.chat textarea { min-height: 0; resize: none; }
.chat-note { margin: .3rem 0 0; font-size: .78rem; color: var(--muted); }
.chat-start > .chat-note { margin: 0; }
.chat-hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.chat-convo { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.chat-messages {
  flex: 1; overflow-y: auto; padding: 1rem; display: flex; flex-direction: column; gap: .55rem;
  background: var(--surface);
}
.chat-msg { max-width: 82%; padding: .55rem .8rem; border-radius: 14px; font-size: .94rem; line-height: 1.45; overflow-wrap: anywhere; }
.chat-msg p { margin: 0; white-space: pre-wrap; }
.chat-msg.staff { align-self: flex-start; background: var(--white); border: 1px solid var(--line); border-bottom-left-radius: 4px; }
.chat-msg.mine { align-self: flex-end; background: var(--lake); color: #fff; border-bottom-right-radius: 4px; }
.chat-time { display: block; margin-top: .2rem; font-size: .7rem; opacity: .7; }

.chat-send {
  display: flex; align-items: flex-end; gap: .5rem; padding: .7rem;
  padding-bottom: calc(.7rem + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid var(--line); background: var(--white);
}
.chat-send textarea { flex: 1; max-height: 110px; }
.chat-send-btn {
  flex: none; display: grid; place-items: center; width: 42px; height: 42px; border: 0; border-radius: 50%;
  background: var(--lake); color: #fff; cursor: pointer;
}
.chat-send-btn:hover { background: var(--lake-dark); }
.chat-send-btn:disabled, .chat-start .btn:disabled { opacity: .6; cursor: default; }
.chat-send-btn svg { width: 20px; height: 20px; }
.chat-ended { padding: 1rem; text-align: center; border-top: 1px solid var(--line); background: var(--white); }
.chat-ended p { margin: 0 0 .6rem; font-weight: 600; color: var(--ink); }

@media (max-width: 520px) {
  .chat-launch-label { display: none; }
  .chat-launch { padding: .95rem; }
  .chat-panel {
    position: fixed; inset: auto 0 0 0; width: 100%; height: min(82vh, 640px);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  }
}
@media (prefers-reduced-motion: reduce) {
  .chat.has-unread .chat-launch { animation: none; }
}

/* ---------- Account dropdown ---------- */
.user-menu { position: relative; }
.user-menu-btn {
  display: inline-flex; align-items: center; gap: .5rem;
  padding: .3rem .7rem .3rem .3rem; border: 1px solid var(--line); border-radius: 999px;
  background: var(--white); color: var(--ink); cursor: pointer;
  font: 600 .95rem var(--font-body); transition: border-color .15s;
}
.user-menu-btn:hover, .user-menu.open .user-menu-btn { border-color: var(--ink); }
.user-avatar {
  display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%;
  background: var(--lake-tint); color: var(--lake-dark);
}
.user-avatar svg { width: 18px; height: 18px; }
.user-caret { width: 16px; height: 16px; transition: transform .15s; }
.user-menu.open .user-caret { transform: rotate(180deg); }

.user-menu-list {
  display: none; position: absolute; right: 0; top: calc(100% + .5rem); z-index: 55;
  min-width: 230px; padding: .4rem; background: var(--white);
  border: 1px solid var(--line); border-radius: var(--radius-md); box-shadow: var(--shadow);
}
.user-menu.open .user-menu-list { display: block; }
.user-menu-head { padding: .6rem .8rem .7rem; margin-bottom: .3rem; border-bottom: 1px solid var(--line); }
.user-menu-head strong { display: block; color: var(--ink); }
.user-menu-head span { font-size: .85rem; color: var(--muted); }
.user-menu-item {
  display: block; width: 100%; padding: .6rem .8rem; border: 0; border-radius: var(--radius-sm);
  background: none; color: var(--text); text-align: left; text-decoration: none; cursor: pointer;
  font: 500 .95rem var(--font-body);
}
.user-menu-item:hover { background: var(--surface); color: var(--ink); }
.user-menu-form { margin: .3rem 0 0; padding-top: .3rem; border-top: 1px solid var(--line); }

@media (max-width: 1100px) and (min-width: 761px) {
  .user-menu-name { display: none; }
  .user-menu-btn { padding-right: .55rem; }
}

@media (max-width: 760px) {
  .user-menu-btn { display: none; }
  .user-menu-list {
    display: block; position: static; min-width: 0; padding: 0;
    border: 0; box-shadow: none; background: none;
  }
  .user-menu-head { padding: .8rem 0; margin: 0; }
  .user-menu-item { padding: .8rem 0; border-bottom: 1px solid var(--line); border-radius: 0; }
  .user-menu-item:hover { background: none; }
  .user-menu-form { margin: 0; padding: 0; border-top: 0; }
  .user-menu-form .user-menu-item { border-bottom: 0; }
}

/* ---------- Step 10: branding and demo ---------- */
.brand-logo { display: block; height: 36px; width: auto; max-width: 220px; }

/* Demo bar */
.demo-bar { background: var(--ink); color: #E3ECF0; font-size: .88rem; }
.demo-row { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: .5rem 1.5rem; padding: .55rem 0; }
.demo-note { margin: 0; }
.demo-note strong { color: #fff; }
.demo-switch { display: flex; align-items: center; flex-wrap: wrap; gap: .4rem; margin: 0; }
.demo-label { margin-right: .2rem; color: #B9CBD4; }
.demo-chip {
  padding: .25rem .8rem; border: 1px solid rgba(255, 255, 255, .35); border-radius: 999px;
  background: transparent; color: #fff; cursor: pointer; font: 600 .82rem var(--font-body);
}
.demo-chip:hover { border-color: #fff; }
.demo-chip[aria-pressed="true"] { background: #fff; border-color: #fff; color: var(--ink); }
.demo-walk { margin-left: .4rem; color: #fff; font-weight: 600; text-underline-offset: 3px; }

/* Walkthrough */
.walk { display: grid; gap: 1.5rem; max-width: 760px; counter-reset: step; }
.walk > li { position: relative; padding-left: 3.4rem; counter-increment: step; }
.walk > li::before {
  content: counter(step); position: absolute; left: 0; top: 0; width: 2.3rem; height: 2.3rem;
  display: grid; place-items: center; border-radius: 50%; background: var(--lake); color: #fff;
  font: 700 1rem var(--font-display);
}
.walk h3 { margin: 0 0 .25rem; }
.walk p { margin: 0 0 .7rem; color: var(--muted); }
.walk .inline-form { margin: 0; }

/* Roadmap voting */
.vote-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1rem; margin-top: 1.25rem; }
.vote-card {
  display: flex; flex-direction: column; gap: .5rem; padding: 1.25rem;
  background: var(--white); border: 1px solid var(--line); border-radius: var(--radius-md);
}
.vote-card h3 { margin: 0; }
.vote-card p { flex: 1; margin: 0; color: var(--muted); }
.vote-card form { margin: 0; }
.vote-card .btn.voted { background: var(--lake-tint); border-color: transparent; color: var(--lake-dark); }

/* Site settings */
.settings-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 2rem; align-items: start; max-width: 1040px; }
.settings-preview { position: sticky; top: 90px; }
.settings-preview h2 { font-size: 1.1rem; }
.preset-row { display: flex; flex-wrap: wrap; gap: .5rem; }
.preset {
  display: inline-flex; align-items: center; gap: .5rem; padding: .4rem .85rem .4rem .45rem;
  border: 1px solid var(--line); border-radius: 999px; background: var(--white);
  color: var(--ink); cursor: pointer; font: 600 .88rem var(--font-body);
}
.preset:hover { border-color: var(--ink); }
.preset-dot { width: 22px; height: 22px; border-radius: 50%; background: linear-gradient(135deg, var(--a) 50%, var(--b) 50%); }
input[type=color] {
  width: 100%; height: 46px; padding: .25rem; cursor: pointer;
  border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--white);
}
.logo-now {
  display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; margin-bottom: .6rem; padding: .75rem;
  border: 1px dashed var(--line); border-radius: var(--radius-sm); background: var(--surface);
}
.logo-now img { height: 40px; width: auto; max-width: 220px; }
.brand-preview { overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius-md); }
.bp-bar { padding: .85rem 1rem; background: var(--d); color: #fff; }
.bp-name { font: 700 1.1rem var(--font-display); }
.bp-body { display: flex; align-items: center; flex-wrap: wrap; gap: .75rem; padding: 1rem; background: #fff; }
.bp-btn { padding: .55rem 1rem; border-radius: var(--radius-sm); background: var(--p); color: #fff; font-weight: 600; }
.bp-chip {
  padding: .15rem .65rem; border-radius: 999px; font-size: .8rem; font-weight: 700;
  background: color-mix(in srgb, var(--p) 12%, #fff); color: var(--p);
}
.bp-link { color: var(--p); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }

@media (max-width: 900px) {
  .settings-layout { grid-template-columns: 1fr; }
  .settings-preview { position: static; }
}


/* ---------- Home banner video ---------- */
.hero { position: relative; overflow: hidden; }
.hero-inner { position: relative; z-index: 1; }
.hero.hero-media { display: flex; align-items: center; min-height: min(80vh, 760px); }
/* .hero.hero-media > .hero-inner { width: 100%; } */

.hero-bg { position: absolute; inset: 0; z-index: 0; }
.hero-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .9s ease; }
.hero-video.is-playing { opacity: 1; }

/* Keeps the headline readable on any footage, using the owner's own dark colour */
.hero-shade {
  position: absolute; inset: 0;
  background:
    linear-gradient(90deg,
      color-mix(in srgb, var(--ink) 90%, transparent) 0%,
      color-mix(in srgb, var(--ink) 72%, transparent) 60%,
      color-mix(in srgb, var(--ink) 45%, transparent) 100%),
    linear-gradient(0deg, color-mix(in srgb, var(--ink) 55%, transparent), transparent 40%);
}
.hero.hero-media .hero-sub { color: #E3ECF0; }

.hero-toggle {
  position: absolute; right: 1rem; bottom: 1rem; z-index: 2;
  display: inline-flex; align-items: center; gap: .45rem; padding: .45rem .9rem;
  border: 1px solid rgba(255, 255, 255, .45); border-radius: 999px; cursor: pointer;
  background: color-mix(in srgb, var(--ink) 75%, transparent); color: #fff;
  font: 600 .85rem var(--font-body);
}
.hero-toggle:hover { border-color: #fff; }
.hero-toggle svg { width: 16px; height: 16px; }

@media (max-width: 700px) {
  .hero.hero-media { display: block; min-height: 0; }
}