/* The Buyers Corner brand: navy, cream and sand · Fraunces + Inter */
@import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,500;9..144,600&family=Inter:wght@400;500;600;700&display=swap');

:root {
  /* Brand colours (from the brand pack) */
  --navy: #14304A;
  --navy-deep: #0D2236;
  --cream: #F5EFE4;
  --sand: #D9B77E;
  --slate: #4A5D70;
  --mist: #C9D3DD;

  /* Tints built from them */
  --navy-soft: #E4E9EF;
  --sand-dark: #C49F62;
  --sand-soft: #F4E9D6;
  --sand-ink: #8C6A33;
  --cream-light: #FBF8F2;

  --bg: var(--cream);
  --surface: #FFFFFF;
  --ink: var(--navy);
  --muted: var(--slate);
  --line: #E6DDCC;
  --field: #D8CEBD;
  --love: #3E7A5B;
  --love-soft: #E2EFE7;
  --maybe: #A06F24;
  --maybe-soft: #F6EAD5;
  --pass: #9B4038;
  --pass-soft: #F6E3E0;
  --radius: 4px;
  --shadow: 0 1px 2px rgba(20,48,74,.05), 0 8px 24px rgba(20,48,74,.07);
  --serif: "Fraunces", Georgia, "Times New Roman", serif;
  --sans: "Inter", -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.55;
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--navy); text-decoration-color: var(--sand); text-underline-offset: 3px; }
h1, h2, h3 { font-family: var(--serif); font-weight: 600; line-height: 1.15; margin: 0 0 .5em; letter-spacing: -.01em; }
h1 { font-size: 2.1rem; }
h2 { font-size: 1.4rem; }
h3 { font-size: 1.12rem; }
.eyebrow {
  font-size: .7rem; font-weight: 600; letter-spacing: .2em; text-transform: uppercase; color: var(--slate);
  display: flex; align-items: center; gap: 10px; margin-bottom: 10px;
}
.eyebrow::after { content: ""; width: 32px; height: 2px; background: var(--sand); }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.hidden { display: none !important; }

/* ---------- Top bar ---------- */
.topbar {
  background: var(--navy);
  color: var(--cream);
  padding: 10px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  position: sticky;
  top: 0;
  z-index: 10;
  border-bottom: 3px solid var(--sand);
}
.topbar .logo { height: 54px; display: block; }
.topbar .brand { display: flex; align-items: center; gap: 16px; }
.topbar .brand .sub {
  color: var(--mist); font-size: .7rem; letter-spacing: .18em; text-transform: uppercase;
  border-left: 1px solid rgba(245,239,228,.25); padding-left: 16px;
}
.topbar .actions { display: flex; gap: 6px; align-items: center; }
.mainnav { display: flex; gap: 4px; border-left: 1px solid rgba(245,239,228,.22); padding-left: 16px; }
.mainnav a {
  color: rgba(245,239,228,.78); text-decoration: none; font-size: .78rem; font-weight: 600; letter-spacing: .16em;
  text-transform: uppercase; padding: 8px 12px; border-bottom: 2px solid transparent;
}
.mainnav a:hover { color: var(--cream); }
.mainnav a.on { color: var(--cream); border-bottom-color: var(--sand); }
.topbar .back-btn {
  color: var(--cream); text-decoration: none; font-size: .86rem; font-weight: 600;
  border: 1px solid rgba(245,239,228,.35); border-radius: var(--radius); padding: 8px 14px; white-space: nowrap;
  transition: background .15s, border-color .15s;
}
.topbar .back-btn:hover { background: rgba(245,239,228,.08); border-color: var(--sand); }
.topbar button { background: transparent; color: rgba(245,239,228,.85); border-color: transparent; font-weight: 500; }
.topbar button:hover { background: rgba(245,239,228,.08); color: var(--cream); border-color: transparent; }
/* ☰ menu for Password / Log out: only used on small screens (see the media queries at the end) */
.topbar .actions { position: relative; }
.menu-pop { display: contents; }
.topbar .menu-btn { display: none; width: 42px; height: 42px; padding: 0; justify-content: center; border: 1px solid rgba(245,239,228,.3); }
.menu-btn span, .menu-btn span::before, .menu-btn span::after {
  display: block; width: 18px; height: 2px; background: var(--cream); border-radius: 1px; position: relative;
}
.menu-btn span::before, .menu-btn span::after { content: ""; position: absolute; left: 0; }
.menu-btn span::before { top: -6px; }
.menu-btn span::after { top: 6px; }

/* ---------- Layout ---------- */
.container { max-width: 1200px; margin: 0 auto; padding: 32px 28px 64px; }
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px;
}
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }

/* ---------- Forms ---------- */
label { display: block; font-size: .76rem; font-weight: 600; margin: 0 0 5px; color: var(--slate); letter-spacing: .02em; }
input, textarea, select {
  width: 100%;
  font: inherit;
  padding: 10px 12px;
  border: 1px solid var(--field);
  border-radius: var(--radius);
  background: #fff;
  color: var(--ink);
}
input:focus, textarea:focus, select:focus { outline: 3px solid var(--sand-soft); border-color: var(--sand-dark); }
input[readonly] { background: var(--cream-light); color: var(--slate); }
textarea { resize: vertical; min-height: 72px; }
.field { margin-bottom: 14px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 14px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0 14px; }

button, .btn {
  font: inherit;
  font-weight: 600;
  font-size: .88rem;
  cursor: pointer;
  border-radius: var(--radius);
  padding: 9px 16px;
  border: 1px solid var(--field);
  background: #fff;
  color: var(--ink);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  transition: background .15s, border-color .15s, color .15s;
}
button:hover, .btn:hover { border-color: var(--navy); }
button.primary { background: var(--navy); color: var(--cream); border-color: var(--navy); }
button.primary:hover { background: var(--navy-deep); }
button.accent, a.btn.accent-btn { background: var(--sand); color: var(--navy); border-color: var(--sand); }
button.accent:hover, a.btn.accent-btn:hover { background: var(--sand-dark); border-color: var(--sand-dark); }
button.danger { color: var(--pass); }
button.link { background: none; border: none; padding: 0; color: var(--navy); font-weight: 600; text-decoration: underline; text-decoration-color: var(--sand); text-underline-offset: 3px; }
button.link.danger { color: var(--pass); text-decoration-color: currentColor; }
button:disabled { opacity: .55; cursor: default; }
.error { color: var(--pass); font-size: .9rem; min-height: 1.2em; margin: 6px 0; }

/* Decorative house mark used behind navy panels that have no photo */
.mark-bg::after {
  content: ""; position: absolute; right: -60px; bottom: -70px; width: 420px; height: 420px;
  background: url('/brand/mark-cream.svg') no-repeat center / contain; opacity: .07; pointer-events: none;
}

/* ---------- Login (split screen) ---------- */
.split { min-height: 100vh; display: grid; grid-template-columns: 1.15fr 1fr; }
.split .visual {
  position: relative;
  background: var(--navy) url('/brand/login-home.jpg') 34% center / cover no-repeat;
  color: var(--cream);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 48px;
  overflow: hidden;
}
.split .visual::before {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(38,29,22,.5) 0%, rgba(38,29,22,0) 32%, rgba(38,29,22,0) 58%, rgba(38,29,22,.78) 100%);
}
.split .visual > * { position: relative; z-index: 1; }
.split .visual .logo-link { align-self: flex-start; }
.split .visual .logo { display: block; height: 120px; }
.split .visual blockquote {
  margin: 0; font-family: var(--serif); font-weight: 500; font-size: 2.2rem; line-height: 1.2; max-width: 520px;
}
.split .visual blockquote::before {
  content: ""; display: block; width: 48px; height: 3px; background: var(--sand); margin-bottom: 22px;
}
.split .panel { display: grid; place-items: center; padding: 40px 28px; background: var(--cream-light); }
.split .panel form, .split .panel > div { width: 100%; max-width: 380px; }
.split .panel h1 { font-size: 2rem; }
.split .panel button.primary { width: 100%; justify-content: center; padding: 12px; margin-top: 8px; }
.split .mobile-logo { display: none; height: 64px; margin-bottom: 28px; }

/* ---------- Simple centred auth (setup, choose password) ---------- */
.auth-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.auth-card { width: 100%; max-width: 420px; border-top: 3px solid var(--sand); }
.auth-card .logo { height: 64px; margin-bottom: 20px; }
.auth-card button.primary { width: 100%; justify-content: center; padding: 12px; margin-top: 6px; }

/* ---------- Client board: the photo sits behind the whole page ---------- */
body.photo-page { background: var(--navy); }
body.photo-page::before {
  content: ""; position: fixed; inset: 0; z-index: -1;
  background: linear-gradient(rgba(38,29,22,.58), rgba(38,29,22,.58)), url('/brand/board-home.jpg') center / cover no-repeat;
}
.photo-page .board-help { color: var(--cream); text-shadow: 0 1px 3px rgba(0,0,0,.55); }
.photo-page footer.site { color: var(--cream); background: none; border-color: transparent; }
.photo-page footer.site img { display: none; }
.preview-bar {
  position: sticky; top: 0; z-index: 60; display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  padding: 10px 28px; background: var(--sand); color: var(--navy); font-size: .9rem;
}
.previewing .topbar { position: static; }
.previewing .topbar .actions, .previewing .topbar .menu-btn, .previewing .topbar .menu-pop { display: none; }
.hero { color: var(--cream); }
.hero .inner { max-width: 1200px; margin: 0 auto; padding: 56px 28px 50px; }
.hero h1 { font-size: 2.6rem; margin-bottom: 10px; }
.hero .eyebrow { color: var(--mist); }

/* ---------- Pills & badges ---------- */
.pill {
  display: inline-block;
  font-size: .66rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 2px;
  background: var(--navy-soft);
  color: var(--navy);
  text-transform: uppercase;
  letter-spacing: .12em;
}
.pill.status-shortlisted { background: var(--cream); color: var(--navy); }
.pill.status-inspecting { background: var(--sand); color: var(--navy); }
.pill.status-offer_made { background: var(--maybe-soft); color: var(--maybe); }
.pill.status-purchased { background: var(--love); color: #fff; }
.pill.status-withdrawn { background: #ECE8E1; color: #7A7468; }
.pill.stage-qualifying { background: var(--navy-soft); color: var(--navy); }
.pill.stage-not_interested { background: var(--pass-soft); color: var(--pass); }
.pill.stage-feedback { background: var(--maybe-soft); color: var(--maybe); }
.pill.stage-interested { background: var(--love-soft); color: var(--love); }
.pill.stage-due_diligence { background: var(--navy); color: var(--cream); }
.stage-picker { display: grid; gap: 6px; }
.stage-picker button { justify-content: flex-start; gap: 10px; font-weight: 500; }
.stage-picker button::before { content: ""; width: 10px; height: 10px; border-radius: 2px; background: var(--mist); }
.stage-picker button[data-stage=qualifying]::before { background: var(--slate); }
.stage-picker button[data-stage=not_interested]::before { background: var(--pass); }
.stage-picker button[data-stage=feedback]::before { background: var(--maybe); }
.stage-picker button[data-stage=interested]::before { background: var(--love); }
.stage-picker button[data-stage=due_diligence]::before { background: var(--sand); }
.stage-picker.om button::before { background: var(--sand); }
.on-boards { list-style: none; margin: 0 0 12px; padding: 0; }
.on-boards li { padding: 6px 0; border-bottom: 1px solid var(--line); font-weight: 600; }
.on-boards li::before { content: "✓"; color: var(--love); margin-right: 8px; }
.pill.stage-om { background: var(--sand); color: var(--navy); }
.stage-picker button.on { background: var(--navy); color: var(--cream); border-color: var(--navy); font-weight: 600; }

/* ---------- Admin ---------- */
.admin-layout { display: grid; grid-template-columns: 290px minmax(0, 1fr); gap: 26px; align-items: start; }
.client-list { padding: 0; overflow: hidden; }
.client-list .head { padding: 18px; border-bottom: 1px solid var(--line); }
.client-list ul { list-style: none; margin: 0; padding: 0; max-height: 70vh; overflow-y: auto; }
.client-list li {
  padding: 13px 18px; border-bottom: 1px solid var(--line); cursor: pointer;
  display: flex; justify-content: space-between; align-items: center; gap: 8px;
  border-left: 3px solid transparent;
}
.client-list li:hover { background: var(--cream-light); }
.client-list li.on { background: var(--sand-soft); border-left-color: var(--sand); }
.client-list li .name { font-weight: 600; }
.client-list .count { font-size: .76rem; color: var(--muted); white-space: nowrap; }

/* Clients list */
.client-table { padding: 0; overflow: hidden; }
.client-row {
  display: grid; grid-template-columns: 44px minmax(150px, 1.3fr) 110px minmax(260px, 2fr) 120px 100px; gap: 16px; align-items: center;
  padding: 14px 20px; border-bottom: 1px solid var(--line); color: inherit; text-decoration: none; transition: background .12s;
}
.client-row:last-child { border-bottom: none; }
.client-row:hover { background: var(--cream-light); }
.client-row:hover .cr-go { color: var(--navy); }
.cr-avatar {
  width: 44px; height: 44px; border-radius: 50%; background: var(--navy); color: var(--cream);
  display: grid; place-items: center; font-family: var(--serif); font-weight: 600; font-size: 1rem;
}
.cr-name .name { font-family: var(--serif); font-weight: 600; font-size: 1.08rem; }
.cr-stages { display: flex; gap: 6px; }
.cr-stage {
  flex: 1; text-align: center; font-family: var(--serif); font-weight: 600; font-size: 1.05rem; line-height: 1.1;
  background: var(--cream-light); border-top: 2px solid var(--mist); padding: 5px 2px 4px; border-radius: 2px;
}
.cr-stage small { display: block; font-family: var(--sans); font-weight: 500; font-size: .56rem; letter-spacing: .04em; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stage-dot-qualifying { border-top-color: var(--slate); }
.stage-dot-not_interested { border-top-color: var(--pass); }
.stage-dot-feedback { border-top-color: var(--maybe); }
.stage-dot-interested { border-top-color: var(--love); }
.stage-dot-due_diligence { border-top-color: var(--sand); }
.cr-go { font-size: .74rem; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--slate); text-align: right; }
.flag-ok { background: var(--love-soft); color: var(--love); }
/* CRM */
.crm-row {
  display: grid; grid-template-columns: minmax(200px, 1.6fr) minmax(120px, 1fr) minmax(140px, 1fr) 80px 70px; gap: 16px; align-items: center;
  padding: 14px 20px; border-bottom: 1px solid var(--line); color: inherit; text-decoration: none;
}
.crm-row:last-child { border-bottom: none; }
.crm-row:hover { background: var(--cream-light); }
.crm-row .name { font-family: var(--serif); font-weight: 600; font-size: 1.08rem; }
.crm-card { margin-bottom: 16px; }
.crm-partner { padding-bottom: 6px; margin-bottom: 14px; border-bottom: 1px solid var(--line); }
.crm-check { display: flex; align-items: center; gap: 10px; font-weight: 600; cursor: pointer; }
.crm-check input { width: 18px; height: 18px; flex: none; margin: 0; }
.crm-save { margin-top: 18px; }
@media (max-width: 760px) {
  .crm-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px 14px; }
  .crm-row > :first-child { grid-column: 1 / -1; }
  .crm-row .cr-go { display: none; }
}
.crumb { display: inline-block; margin-bottom: 14px; font-size: .86rem; font-weight: 600; text-decoration: none; }
.crumb:hover { text-decoration: underline; }

.stat-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 24px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-top: 3px solid var(--sand); border-radius: var(--radius); padding: 16px 18px; }
.stat .n { font-family: var(--serif); font-weight: 600; font-size: 2.1rem; color: var(--navy); line-height: 1.1; }
.stat .l { font-size: .7rem; color: var(--muted); text-transform: uppercase; letter-spacing: .12em; margin-top: 4px; }

.feed li { list-style: none; padding: 14px 0; border-bottom: 1px solid var(--line); }
.feed { margin: 0; padding: 0; }

.brief {
  margin-top: 16px; background: var(--cream-light); border-left: 3px solid var(--sand);
  padding: 12px 14px; white-space: pre-wrap;
}
.brief b { font-size: .66rem; letter-spacing: .16em; color: var(--sand-ink); display: block; margin-bottom: 4px; }

/* Branding uploads */
.upload-row { display: flex; gap: 14px; align-items: center; margin-bottom: 16px; }
.upload-row .preview {
  width: 120px; height: 80px; background: var(--cream-light) center / cover no-repeat; border: 1px dashed var(--field);
  border-radius: var(--radius); flex: none; display: grid; place-items: center; color: var(--slate); font-size: .75rem;
}
.upload-row .preview.round { width: 80px; border-radius: 50%; }
.upload-row input[type=file] { display: none; }

/* Property photo manager (property form) */
.pm-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; }
.pm-grid:not(:empty) { margin-bottom: 10px; }
.pm-item {
  position: relative; aspect-ratio: 3 / 2; background: var(--cream-light); border-radius: var(--radius); overflow: hidden;
  border: 1px solid var(--line);
}
.pm-item img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pm-loading { display: grid; place-items: center; font-size: .8rem; color: var(--muted); }
.pm-cover {
  position: absolute; top: 6px; left: 6px; background: var(--navy); color: var(--cream);
  font-size: .6rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; padding: 2px 7px; border-radius: 2px;
}
.pm-tools { position: absolute; bottom: 6px; right: 6px; display: flex; gap: 4px; }
.pm-tools button {
  width: 26px; height: 26px; padding: 0; justify-content: center; font-size: .8rem;
  background: rgba(13,34,54,.78); color: var(--cream); border: none;
}
.pm-tools button:hover { background: var(--navy); }
.pm-drop, .dropzone {
  border: 1.5px dashed var(--field); border-radius: var(--radius); padding: 16px; text-align: center;
  background: var(--cream-light); transition: background .15s, border-color .15s;
}
.dropzone { margin-bottom: 16px; }
.pm-drop.over, .dropzone.over { background: var(--sand-soft); border-color: var(--sand-dark); }

/* ---------- Property page ---------- */
.p-hero {
  position: relative; min-height: 460px; display: flex; align-items: flex-end; overflow: hidden;
  background: var(--navy) center / cover no-repeat; color: var(--cream);
}
.p-hero::before { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(13,34,54,.4) 0%, rgba(13,34,54,0) 35%, rgba(13,34,54,.9) 100%); }
.p-hero.no-photo { min-height: 300px; }
.p-hero.no-photo::before { background: none; }
.p-hero.no-photo::after {
  content: ""; position: absolute; right: 4%; top: -30px; width: 320px; height: 320px;
  background: url('/brand/mark-cream.svg') no-repeat center / contain; opacity: .07;
}
.p-hero .inner {
  position: relative; z-index: 1; width: 100%; max-width: 1200px; margin: 0 auto; padding: 28px 28px 38px;
  display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; flex-wrap: wrap;
}
.p-hero-text { padding-top: 60px; }
.p-price { font-family: var(--serif); font-weight: 500; font-size: 1.4rem; margin: 14px 0 2px; color: var(--sand); }
.p-hero h1 { font-size: 2.8rem; margin: 0; }
.p-suburb { color: rgba(245,239,228,.78); font-size: 1.05rem; margin-top: 4px; }
.p-hero-actions button { background: var(--cream); border-color: var(--cream); }

.p-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 26px; align-items: start; }
.p-main { display: flex; flex-direction: column; gap: 22px; }
.p-side { display: flex; flex-direction: column; gap: 18px; position: sticky; top: 92px; }
.p-section-head { margin-bottom: 16px; align-items: flex-start; }

.facts {
  display: flex; flex-wrap: wrap;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
}
.fact { flex: 1 1 110px; padding: 16px 18px; box-shadow: 1px 0 0 var(--line), 0 1px 0 var(--line); }
.fact-wide { flex-basis: 190px; }
.fact .v { font-family: var(--serif); font-weight: 600; font-size: 1.35rem; white-space: nowrap; }
.fact .v a { text-decoration: none; }
.fact .l { font-size: .66rem; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin-top: 2px; }

.uploads:empty { display: none; }
.uploads { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; }
.upload { display: grid; grid-template-columns: minmax(0, 1fr) 160px 44px; gap: 10px; align-items: center; font-size: .85rem; }
.upload .u-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.upload .bar { height: 6px; background: var(--line); border-radius: 3px; overflow: hidden; }
.upload .bar span { display: block; height: 100%; width: 0; background: var(--sand); transition: width .2s; }
.upload .u-pct { text-align: right; color: var(--muted); }

.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.m-item { position: relative; margin: 0; border-radius: var(--radius); overflow: hidden; background: var(--cream-light); }
.m-photo { aspect-ratio: 3 / 2; cursor: zoom-in; }
.m-photo:first-child { grid-column: span 2; grid-row: span 2; }
.m-photo img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .3s; }
.m-photo:hover img { transform: scale(1.03); }
.m-tools { position: absolute; bottom: 8px; right: 8px; display: flex; gap: 6px; opacity: 0; transition: opacity .15s; }
.m-item:hover .m-tools, .m-tools:focus-within { opacity: 1; }
.m-tools button { padding: 5px 10px; font-size: .76rem; background: rgba(13,34,54,.85); color: var(--cream); border: none; }
.m-tools button:hover { background: var(--navy); }
.m-video { grid-column: span 2; background: var(--navy); border: 1px solid var(--line); }
.m-video video, .m-video iframe { width: 100%; aspect-ratio: 16 / 9; display: block; border: 0; background: #000; }
.m-video .m-link { display: grid; place-items: center; aspect-ratio: 16 / 9; color: var(--cream); text-decoration: none; font-weight: 600; }
.m-video figcaption { display: flex; justify-content: space-between; gap: 10px; padding: 10px 12px; background: var(--surface); font-size: .88rem; }
.empty-inline { color: var(--muted); padding: 18px 0; grid-column: 1 / -1; }

.docs { display: flex; flex-direction: column; }
.doc { display: flex; align-items: center; gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.doc:last-child { border-bottom: none; }
.doc-name { flex: 1; min-width: 0; }
.doc-name a { font-weight: 600; color: var(--ink); text-decoration: none; word-break: break-word; }
.doc-name a:hover { text-decoration: underline; }
.doc .btn { padding: 6px 12px; font-size: .8rem; }
.doc-icon {
  width: 42px; height: 50px; flex: none; display: grid; place-items: end center; padding-bottom: 7px;
  font-size: .6rem; font-weight: 700; letter-spacing: .04em; color: #fff; border-radius: 3px;
  clip-path: polygon(0 0, 72% 0, 100% 22%, 100% 100%, 0 100%);
}
.doc-pdf { background: #A8483E; }
.doc-doc { background: var(--navy); }
.doc-xls { background: var(--love); }
.doc-img { background: var(--sand-dark); }
.doc-txt { background: var(--slate); }

.contact-card { display: flex; gap: 14px; align-items: center; border-top: 3px solid var(--sand); }
.contact-card .photo {
  width: 64px; height: 64px; border-radius: 50%; object-fit: cover; flex: none; background: var(--sand); color: var(--navy);
  display: grid; place-items: center; font-family: var(--serif); font-weight: 600; font-size: 1.35rem;
}
.contact-card .name { font-family: var(--serif); font-weight: 600; font-size: 1.15rem; }
.contact-card .eyebrow::after { display: none; }
.contact-card a { display: block; font-size: .88rem; text-decoration: none; }

.lightbox { position: fixed; inset: 0; z-index: 80; background: rgba(9,22,35,.95); display: grid; place-items: center; }
.lightbox img { max-width: 92vw; max-height: 86vh; object-fit: contain; }
.lightbox button { position: absolute; background: rgba(245,239,228,.1); color: var(--cream); border: none; }
.lightbox button:hover { background: rgba(245,239,228,.2); }
.lb-close { top: 18px; right: 18px; width: 42px; height: 42px; justify-content: center; padding: 0; }
.lb-nav { top: 50%; transform: translateY(-50%); width: 52px; height: 52px; justify-content: center; padding: 0; font-size: 1.8rem; border-radius: 50% !important; }
.lb-prev { left: 18px; }
.lb-next { right: 18px; }
.lb-count { position: absolute; bottom: 18px; color: rgba(245,239,228,.75); font-size: .85rem; letter-spacing: .08em; }

/* Unsaved changes on the property page */
.savebar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
  background: var(--navy); color: var(--cream); box-shadow: 0 -8px 24px rgba(13,34,54,.2);
  border-top: 3px solid var(--sand); animation: slideup .2s ease;
}
@keyframes slideup { from { transform: translateY(100%); } to { transform: none; } }
.savebar-inner { max-width: 1200px; margin: 0 auto; padding: 14px 28px; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.savebar .small { color: var(--mist); }
.savebar button:not(.accent) { background: transparent; color: var(--cream); border-color: rgba(245,239,228,.35); }
.savebar button:not(.accent):hover { border-color: var(--cream); }
.savebar button.accent { padding: 10px 22px; }
body.has-savebar { padding-bottom: 90px; }
body.has-savebar .toast { bottom: 100px; }
.unsaved-tag {
  display: inline-block; font-size: .62rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
  background: var(--sand-soft); color: var(--sand-ink); padding: 2px 7px; border-radius: 2px; vertical-align: middle; margin-left: 6px;
}
.unsaved-tag.on-photo { position: absolute; top: 6px; right: 6px; margin: 0; }

/* ---------- Shortlist board ---------- */
.board-wrap { max-width: 1680px; margin: 0 auto; padding: 28px 28px 56px; }
.board-tabs { display: none; }
.board {
  position: relative;
  display: grid; grid-template-columns: repeat(5, minmax(250px, 1fr)); gap: 16px;
  overflow-x: auto; padding-bottom: 12px; scroll-snap-type: x proximity; align-items: start;
}
.bcol {
  background: #EDE5D7; border-radius: var(--radius); display: flex; flex-direction: column;
  min-height: 420px; scroll-snap-align: start; border-top: 3px solid var(--mist);
  transition: background .15s, box-shadow .15s;
}
.bcol header { padding: 14px 14px 10px; }
.bcol-title { font-family: var(--serif); font-weight: 600; font-size: 1.12rem; display: flex; align-items: center; gap: 8px; }
.bcol-count {
  font-family: var(--sans); font-size: .7rem; font-weight: 700; background: #fff; color: var(--slate);
  border-radius: 999px; padding: 1px 8px;
}
.bcol-hint { font-size: .76rem; color: var(--muted); margin-top: 2px; }
.bcol-pager {
  display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 0 10px 10px;
  background: #fff; border-radius: var(--radius); font-size: .78rem; font-weight: 600; color: var(--slate);
}
.bcol-cards + .bcol-pager { margin-top: -2px; margin-bottom: 12px; }
.bcol-pager button {
  border: none; background: none; width: 40px; height: 34px; padding: 0; justify-content: center;
  font-size: 1.3rem; line-height: 1; color: var(--navy);
}
.bcol-pager button:hover:not(:disabled) { background: var(--sand-soft); }
.bcol-pager button:disabled { opacity: .2; }
.bcol-cards { padding: 0 10px 12px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.bcol-empty {
  border: 1.5px dashed #D3C7B2; border-radius: var(--radius); padding: 22px 10px; text-align: center;
  color: #9A8F7C; font-size: .82rem; flex: 1; display: grid; place-items: center; max-height: 140px;
}
.bcol.over { background: var(--sand-soft); box-shadow: inset 0 0 0 2px var(--sand-dark); }
.bcol-qualifying { border-top-color: var(--slate); }
.bcol-not_interested { border-top-color: var(--pass); }
.bcol-feedback { border-top-color: var(--maybe); }
.bcol-interested { border-top-color: var(--love); }
.bcol-due_diligence { border-top-color: var(--sand); }

.bcard {
  background: var(--surface); border-radius: var(--radius); overflow: hidden; cursor: grab;
  box-shadow: 0 1px 2px rgba(20,48,74,.08), 0 2px 8px rgba(20,48,74,.05);
  transition: box-shadow .15s, transform .15s, opacity .15s; user-select: none;
}
.bcard:hover { box-shadow: 0 2px 4px rgba(20,48,74,.08), 0 8px 20px rgba(20,48,74,.12); }
.bcard:focus-visible { outline: 3px solid var(--sand); outline-offset: 2px; }
.bcard.dragging { opacity: .35; }
.bcard.just-moved { animation: landed .5s ease; }
@keyframes landed { from { transform: scale(.96); box-shadow: 0 0 0 3px var(--sand); } to { transform: none; } }
.bcard-ghost {
  position: fixed; top: 0; left: 0; z-index: 200; pointer-events: none; cursor: grabbing;
  box-shadow: 0 18px 40px rgba(13,34,54,.3);
}
body.board-dragging, body.board-dragging * { cursor: grabbing !important; user-select: none; }
.bcard-photo {
  position: relative; aspect-ratio: 16 / 10; background: var(--navy) url('/brand/mark-cream.svg') no-repeat center / 64px;
  display: grid; place-items: end center; color: var(--mist); font-size: .74rem; padding-bottom: 10px;
}
.bcard-photo:has(img) { padding: 0; background: var(--navy); }
.bcard-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.bcard-photo .pill { position: absolute; top: 8px; left: 8px; }
.bcard-grip {
  position: absolute; top: 6px; right: 6px; width: 30px; height: 30px; display: grid; place-items: center;
  background: rgba(13,34,54,.6); color: var(--cream); border-radius: var(--radius); font-size: 1rem; touch-action: none; cursor: grab;
}
.bcard-body { padding: 12px 14px 8px; }
.bcard-price { font-family: var(--serif); font-weight: 600; font-size: 1.08rem; }
.bcard-addr { font-weight: 600; font-size: .9rem; margin-top: 2px; }
.bcard-suburb { color: var(--muted); font-size: .82rem; }
.bcard-specs { display: flex; gap: 12px; font-size: .8rem; color: var(--muted); margin-top: 6px; }
.bcard-specs b { color: var(--ink); }
.bcard-meta { font-size: .74rem; color: var(--muted); margin-top: 4px; }
.bcard-comment { font-size: .8rem; margin-top: 8px; padding: 6px 8px; background: var(--cream-light); border-left: 2px solid var(--sand); }
.bcard-move { display: flex; align-items: center; border-top: 1px solid var(--line); }
.bcard-move button {
  border: none; border-radius: 0; background: none; padding: 6px 0; width: 44px; justify-content: center;
  font-size: 1.25rem; line-height: 1; color: var(--navy);
}
.bcard-move button:hover:not(:disabled) { background: var(--sand-soft); }
.bcard-move button:disabled { opacity: .2; }
.bcard-move a { flex: 1; text-align: center; font-size: .76rem; font-weight: 600; text-decoration: none; letter-spacing: .1em; text-transform: uppercase; }
.board-help { color: var(--muted); font-size: .85rem; margin: -6px 0 16px; }
.bcard-agent { font-size: .76rem; color: var(--sand-ink); font-weight: 600; margin-top: 6px; }
.bcard-sale { font-size: .76rem; font-weight: 600; color: var(--navy); margin-top: 6px; }

/* On / off market */
.pill.market-off { background: var(--navy); color: var(--cream); }
.pill.market-on { background: var(--sand); color: var(--navy); }
.bcard-photo .pill.market-off, .bcard-photo .pill.market-on { box-shadow: 0 1px 4px rgba(13,34,54,.25); }
.market-toggle { display: inline-flex; border: 1px solid var(--field); border-radius: var(--radius); overflow: hidden; }
.market-toggle label { margin: 0; cursor: pointer; }
.market-toggle input { position: absolute; opacity: 0; pointer-events: none; width: 1px; height: 1px; }
.market-toggle span { display: block; padding: 9px 18px; font-size: .88rem; font-weight: 600; color: var(--slate); letter-spacing: 0; }
.market-toggle label + label span { border-left: 1px solid var(--field); }
.market-toggle input:checked + span { background: var(--navy); color: var(--cream); }
.market-toggle input[value=on]:checked + span { background: var(--sand); color: var(--navy); }
.market-toggle input:focus-visible + span { outline: 3px solid var(--sand-soft); }
.oh-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 8px; }
.oh-list:empty { display: none; }
.oh-row { display: flex; gap: 12px; align-items: center; }
.oh-row input { max-width: 260px; }
.fact-list .v { font-size: 1rem; white-space: normal; line-height: 1.35; }

/* Dashboard: Properties panel */
.dash-grid { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 20px; margin-bottom: 20px; }
.market-split { display: flex; gap: 10px; margin: 4px 0 16px; }
.market-split a {
  flex: 1; text-decoration: none; color: inherit; border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px;
  border-top: 3px solid var(--navy); background: var(--cream-light);
}
.market-split a.on-m { border-top-color: var(--sand); }
.market-split .n { font-family: var(--serif); font-weight: 600; font-size: 1.8rem; line-height: 1; }
.market-split .l { font-size: .68rem; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin-top: 4px; }
.stage-bars { display: flex; flex-direction: column; gap: 6px; }
.stage-bar { display: grid; grid-template-columns: 150px 1fr 30px; gap: 10px; align-items: center; font-size: .84rem; }
.stage-bar .track { height: 8px; background: var(--cream); border-radius: 4px; overflow: hidden; display: flex; }
.stage-bar .track span { display: block; height: 100%; }
.stage-bar .track .t-off { background: var(--navy); }
.stage-bar .track .t-on { background: var(--sand); }
.stage-bar b { text-align: right; }
.event-list, .hot-list { list-style: none; margin: 0; padding: 0; }
.event-list li, .hot-list li { padding: 11px 0; border-bottom: 1px solid var(--line); display: grid; grid-template-columns: 74px 1fr; gap: 12px; align-items: start; }
.event-list li:last-child, .hot-list li:last-child { border-bottom: none; }
.event-when { text-align: center; background: var(--navy); color: var(--cream); border-radius: var(--radius); padding: 6px 4px; line-height: 1.1; }
.event-when .d { font-family: var(--serif); font-weight: 600; font-size: 1.3rem; }
.event-when .m { font-size: .62rem; letter-spacing: .12em; text-transform: uppercase; color: var(--mist); }
.event-when.auction { background: var(--sand); color: var(--navy); }
.event-when.auction .m { color: var(--navy); }
.event-what a { font-weight: 600; text-decoration: none; color: var(--ink); }
.event-what a:hover { text-decoration: underline; }
.event-kind { font-size: .66rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.who-chips { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 5px; }
.who-chip { font-size: .72rem; padding: 2px 8px; border-radius: 999px; background: var(--cream); text-decoration: none; color: var(--ink); border: 1px solid var(--line); }
.who-chip.stage-interested { background: var(--love-soft); border-color: transparent; }
.who-chip.stage-due_diligence { background: var(--sand-soft); border-color: transparent; }
.hot-list li { grid-template-columns: 56px 1fr; }
.hot-thumb { width: 56px; height: 42px; object-fit: cover; border-radius: 3px; background: var(--navy) url('/brand/mark-cream.svg') no-repeat center / 22px; display: block; }
@media (max-width: 900px) { .dash-grid { grid-template-columns: 1fr; } }

/* Off Market filters */
.filters {
  display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; margin-bottom: 18px;
}
.filters .field { margin: 0; min-width: 150px; flex: 0 1 190px; }
.filters select { padding: 8px 10px; }
.filters-end { display: flex; gap: 14px; align-items: center; margin-left: auto; padding-bottom: 8px; }

/* ---------- Invites and password resets ---------- */
.flag {
  display: inline-block; margin-top: 4px; font-size: .62rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
  background: var(--navy-soft); color: var(--navy); padding: 2px 6px; border-radius: 2px;
}
.flag-alert { background: var(--maybe-soft); color: var(--maybe); }
.alert {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 14px;
  background: var(--sand-soft); border: 1px solid #E9D6B4; border-left: 3px solid var(--sand-dark);
  padding: 12px 14px; font-size: .92rem;
}
.email-preview { border: 1px solid var(--line); border-radius: var(--radius); background: var(--cream-light); margin: 6px 0 8px; }
.email-head { padding: 8px 14px; border-bottom: 1px solid var(--line); font-size: .88rem; }
.email-head span { display: inline-block; width: 64px; color: var(--muted); font-size: .7rem; text-transform: uppercase; letter-spacing: .12em; }
.email-preview pre {
  margin: 0; padding: 14px; white-space: pre-wrap; font-family: var(--sans); font-size: .9rem; line-height: 1.55;
  max-height: 280px; overflow-y: auto; background: #fff;
}
.pw-wrap { position: relative; }
.pw-wrap input { padding-right: 64px; }
.pw-toggle {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%); padding: 4px 8px; font-size: .76rem;
  border: none; background: none; color: var(--slate);
}
.auth-links { margin-top: 18px; font-size: .88rem; }

/* ---------- Agent-only vs client-facing on a property ---------- */
.zone-tag {
  display: flex; align-items: center; gap: 8px; font-size: .68rem; font-weight: 700; letter-spacing: .16em;
  text-transform: uppercase;
}
.zone-tag::before { content: ""; width: 10px; height: 10px; border-radius: 50%; flex: none; }
.zone-tag.private { color: var(--navy); margin-bottom: 14px; }
.zone-tag.private::before { background: var(--navy); border-radius: 2px; }
.zone-tag.client { color: var(--love); margin: 4px 0 -8px; padding-top: 14px; border-top: 2px dashed var(--line); }
.zone-tag.client::before { background: var(--love); }
.private-card {
  background: repeating-linear-gradient(135deg, #fff 0 14px, #FBF8F2 14px 28px);
  border: 2px solid var(--navy); box-shadow: 0 0 0 4px var(--sand-soft);
}
.private-card textarea { background: #fff; }
.private-grid { gap: 0 16px; }

/* ---------- Messages and comment threads ---------- */
.thread { display: flex; flex-direction: column; min-height: 0; }
.thread-list { flex: 1; overflow-y: auto; padding: 4px 2px 10px; display: flex; flex-direction: column; gap: 4px; }
.thread-empty { color: var(--muted); font-size: .88rem; text-align: center; padding: 26px 10px; margin: auto 0; }
.msg { max-width: 84%; display: flex; flex-direction: column; }
.msg.mine { align-self: flex-end; align-items: flex-end; }
.msg.theirs { align-self: flex-start; align-items: flex-start; }
.msg-who { font-size: .66rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin: 8px 4px 3px; }
.msg-body {
  padding: 9px 13px; border-radius: 14px; white-space: pre-wrap; word-break: break-word; font-size: .92rem; line-height: 1.45;
}
.msg.mine .msg-body { background: var(--navy); color: var(--cream); border-bottom-right-radius: 4px; }
.msg.theirs .msg-body { background: #fff; border: 1px solid var(--line); border-bottom-left-radius: 4px; }
.msg-time { font-size: .68rem; color: var(--muted); margin: 3px 6px 0; }
.thread-form { display: flex; gap: 8px; align-items: flex-end; border-top: 1px solid var(--line); padding-top: 10px; }
.thread-form textarea { min-height: 44px; max-height: 140px; resize: vertical; }
.thread-form button { padding: 11px 16px; }

/* Comments card on a property */
.comments-card .thread { height: 340px; }
.comments-card .privacy { font-size: .74rem; color: var(--muted); margin: -4px 0 10px; display: flex; gap: 6px; align-items: center; }
.privacy::before { content: ""; width: 10px; height: 12px; background: var(--sand); clip-path: polygon(15% 40%, 15% 25%, 30% 5%, 70% 5%, 85% 25%, 85% 40%, 100% 40%, 100% 100%, 0 100%, 0 40%, 28% 40%, 28% 28%, 38% 16%, 62% 16%, 72% 28%, 72% 40%); }

/* Floating Messages button + panel */
.messenger-btn {
  position: fixed; right: 22px; bottom: 22px; z-index: 40; padding: 12px 18px; border-radius: 999px;
  background: var(--navy); color: var(--cream); border: 2px solid var(--sand); box-shadow: 0 8px 24px rgba(13,34,54,.3);
  font-size: .9rem; gap: 10px;
}
.messenger-btn:hover { background: var(--navy-deep); border-color: var(--sand); }
.mb-icon { width: 18px; height: 15px; background: var(--sand); border-radius: 4px 4px 4px 1px; position: relative; }
.mb-icon::after { content: ""; position: absolute; left: 2px; bottom: -4px; border: 4px solid transparent; border-top-color: var(--sand); border-left-color: var(--sand); }
.mb-badge { background: var(--pass); color: #fff; border-radius: 999px; font-size: .7rem; min-width: 20px; height: 20px; display: grid; place-items: center; padding: 0 5px; }
body.has-savebar .messenger-btn { bottom: 96px; }
.messenger {
  position: fixed; right: 0; top: 0; bottom: 0; width: min(420px, 100vw); z-index: 70;
  background: var(--cream-light); border-left: 3px solid var(--sand); box-shadow: -12px 0 36px rgba(13,34,54,.18);
  display: flex; flex-direction: column; animation: slidein .2s ease;
}
@keyframes slidein { from { transform: translateX(100%); } to { transform: none; } }
.messenger header { background: var(--navy); color: var(--cream); padding: 18px 20px; display: flex; align-items: flex-start; gap: 12px; }
.messenger header > div { flex: 1; }
.messenger .eyebrow { color: var(--mist); }
.m-title { font-family: var(--serif); font-weight: 600; font-size: 1.25rem; }
.m-sub { font-size: .78rem; color: var(--mist); margin-top: 2px; }
.m-close { background: transparent; border: none; color: var(--cream); font-size: 1.1rem; padding: 4px 8px; }
.m-close:hover { background: rgba(245,239,228,.1); }
.m-thread { flex: 1; min-height: 0; padding: 12px 16px 16px; }
.m-thread .thread { height: 100%; }

.bcard-talk { display: inline-flex; gap: 5px; align-items: center; font-size: .74rem; color: var(--muted); margin-top: 6px; }
.bcard-talk.unread { color: var(--pass); font-weight: 700; }
.bcard-talk::before { content: ""; width: 11px; height: 9px; background: currentColor; border-radius: 2px 2px 2px 0; opacity: .8; }
.unread-dot { display: inline-block; background: var(--pass); color: #fff; border-radius: 999px; font-size: .64rem; font-weight: 700; padding: 1px 7px; margin-left: 6px; vertical-align: middle; }

/* ---------- Modal ---------- */
.modal-bg {
  position: fixed; inset: 0; background: rgba(13,34,54,.55); display: grid; place-items: center;
  padding: 20px; z-index: 50; overflow-y: auto;
}
.modal { width: 100%; max-width: 640px; max-height: calc(100vh - 40px); overflow-y: auto; border-top: 3px solid var(--sand); }
.modal .foot { display: flex; justify-content: flex-end; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.modal h2 { margin-bottom: 18px; }

.notice {
  background: var(--navy-soft); border: 1px solid var(--mist); border-radius: var(--radius);
  padding: 14px 16px; margin: 10px 0; font-size: .92rem;
}
.notice code { font-size: 1rem; font-weight: 700; background: #fff; padding: 2px 6px; border-radius: 2px; }

.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  background: var(--navy); color: var(--cream); padding: 11px 20px; border-radius: var(--radius); z-index: 100;
  box-shadow: var(--shadow); font-size: .92rem; border-left: 3px solid var(--sand);
}

.empty { text-align: center; padding: 56px 20px; color: var(--muted); }
.empty h3 { color: var(--ink); }

footer.site {
  text-align: center; color: var(--slate); font-size: .7rem; letter-spacing: .24em; text-transform: uppercase;
  padding: 8px 20px 40px;
}
footer.site img { display: block; height: 34px; margin: 0 auto 10px; opacity: .9; }

/* Touch screens have no hover, so photo tools are always shown there. */
@media (hover: none) {
  .m-tools { opacity: 1; }
}

@media (max-width: 1150px) {
  .client-row { grid-template-columns: 44px minmax(140px, 1fr) 100px minmax(240px, 2fr) 90px; }
  .cr-activity { display: none; }
}
@media (max-width: 900px) {
  .split { grid-template-columns: 1fr; }
  .split .visual { display: none; }
  .split .mobile-logo { display: block; }
  .admin-layout { grid-template-columns: 1fr; }
  .p-layout { grid-template-columns: 1fr; }
  .board { grid-template-columns: repeat(5, 78vw); scroll-snap-type: x mandatory; }
  .board-wrap { padding: 20px 16px 40px; }
  .p-side { position: static; }
  .p-hero h1 { font-size: 2.1rem; }
  .stat-row { grid-template-columns: repeat(2, 1fr); }
  .grid-3, .grid-4 { grid-template-columns: 1fr 1fr; }
  .client-row { grid-template-columns: 44px 1fr auto; }
  .cr-stages, .cr-activity, .cr-go { display: none; }

  /* iPhones zoom in on text boxes smaller than 16px */
  input, textarea, select { font-size: 16px; }

  /* Top bar: logo and ☰ menu on the first row, page links on a second row */
  .topbar { flex-wrap: wrap; row-gap: 2px; padding: 8px 16px; }
  .topbar:has(.mainnav) { padding-bottom: 0; }
  .topbar .brand { display: contents; }
  .topbar .logo { height: 40px; }
  .topbar .brand:has(.back-btn) > a:first-child { display: none; }
  .mainnav {
    order: 3; flex-basis: 100%; border-left: none; padding-left: 0; margin: 0 -10px;
    overflow-x: auto; scrollbar-width: none;
  }
  .mainnav::-webkit-scrollbar { display: none; }
  .mainnav a { padding: 10px; white-space: nowrap; }
  .topbar .actions { margin-left: auto; }
  .topbar .menu-btn { display: inline-flex; }
  .menu-pop {
    display: none; position: absolute; right: 0; top: calc(100% + 8px); z-index: 30; min-width: 190px;
    flex-direction: column; padding: 6px; background: var(--navy); border: 1px solid rgba(245,239,228,.18);
    border-top: 2px solid var(--sand); border-radius: var(--radius); box-shadow: 0 12px 30px rgba(13,34,54,.35);
  }
  .actions.open .menu-pop { display: flex; }
  .menu-pop button { width: 100%; justify-content: flex-start; padding: 12px 14px; font-size: .95rem; }

  /* Board: column tabs, one column per screen */
  .board-tabs {
    display: flex; gap: 6px; overflow-x: auto; position: relative; margin: 0 -16px 12px; padding: 2px 16px;
    scrollbar-width: none;
  }
  .board-tabs::-webkit-scrollbar { display: none; }
  .board-tabs button {
    flex: none; padding: 7px 12px; font-size: .8rem; border-radius: 999px; background: #fff; border-color: var(--line); gap: 7px;
  }
  .board-tabs button span { font-size: .7rem; background: var(--cream); color: var(--slate); border-radius: 999px; padding: 0 7px; }
  .board-tabs button.on { background: var(--navy); color: var(--cream); border-color: var(--navy); }
  .board-tabs button.on span { background: rgba(245,239,228,.18); color: var(--cream); }
  .bcard-move button { width: 52px; padding: 10px 0; }
}
@media (max-width: 560px) {
  .container { padding: 22px 16px 50px; }
  .topbar .brand .sub { display: none; }
  .mainnav a { padding: 10px 6px; font-size: .68rem; letter-spacing: .06em; }
  .topbar .back-btn { padding: 9px 12px; font-size: .84rem; }
  .filters { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 12px; }
  .filters .field { min-width: 0; }
  .filters-end { flex-direction: column; align-items: flex-end; gap: 4px; padding-bottom: 4px; }
  .fact-wide { flex-basis: 40%; }
  .modal-bg { padding: 10px; }
  .modal { max-height: calc(100vh - 20px); padding: 18px; }
  .hero .inner { padding: 36px 16px 32px; }
  .hero h1 { font-size: 1.9rem; }
  .grid-2 { grid-template-columns: 1fr; }
  .p-hero { min-height: 340px; }
  .p-hero .inner { padding: 24px 16px 28px; }
  .m-photo:first-child, .m-video { grid-column: auto; grid-row: auto; }
  .upload { grid-template-columns: minmax(0, 1fr) 80px 40px; }
  .doc { flex-wrap: wrap; }
}
