/* ============================================================
   HAUSBRICKS APP.CSS — App shell, panels, cards, modals
   Includes: Auth gate, Circumstances editor, Image cards,
   Gallery, Score badges, Toast, Compare table, Checklist,
   Costs, Negotiate, AI Analyst
   ============================================================ */

/* ── Reset & base ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

.app-body {
  font-family: 'DM Sans', sans-serif;
  background: var(--bg, #f7f6f3);
  color: var(--ink, #1a1a18);
  min-height: 100vh;
  overflow: hidden;
}

/* ── CSS Variables ── */
:root {
  --bg: #f7f6f3;
  --bg-2: #f0ede8;
  --surface: #ffffff;
  --surface-2: #faf9f7;
  --border: #e8e4de;
  --border-2: #d4cfc8;
  --ink: #1a1a18;
  --ink-2: #4a4a46;
  --ink-3: #7a7a74;
  --accent: #1a1a18;
  --accent-hover: #333330;
  --green: #2d6a4f;
  --green-bg: #d8f3dc;
  --amber: #b45309;
  --amber-bg: #fef3c7;
  --red: #991b1b;
  --red-bg: #fee2e2;
  --blue: #1e40af;
  --blue-bg: #dbeafe;
  --sidebar-w: 260px;
  --topbar-h: 60px;
  --radius: 10px;
  --radius-lg: 16px;
  --shadow: 0 1px 3px rgba(0,0,0,0.08), 0 4px 12px rgba(0,0,0,0.06);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.12), 0 2px 8px rgba(0,0,0,0.08);
}

/* ============================================================
   AUTH GATE
   ============================================================ */

.auth-gate {
  position: fixed;
  inset: 0;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 24px;
}

.auth-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 40px 36px;
  width: 100%;
  max-width: 420px;
  box-shadow: var(--shadow-lg);
}

.auth-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
}

.auth-logo .logo-mark {
  font-size: 20px;
  line-height: 1;
}

.auth-logo .logo-text {
  font-family: 'Playfair Display', serif;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.5px;
  color: var(--ink);
}

.auth-tagline {
  font-size: 13px;
  color: var(--ink-3);
  margin-bottom: 28px;
}

.auth-tabs {
  display: flex;
  gap: 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 24px;
}

.auth-tab {
  flex: 1;
  padding: 10px;
  background: transparent;
  border: none;
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  font-weight: 500;
  color: var(--ink-3);
  cursor: pointer;
  transition: all 0.15s;
}

.auth-tab.active {
  background: var(--ink);
  color: #fff;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.auth-error {
  font-size: 13px;
  color: var(--red);
  min-height: 18px;
}

.auth-submit {
  width: 100%;
  padding: 13px;
  font-size: 15px;
  margin-top: 4px;
}

.auth-footer-note {
  text-align: center;
  font-size: 12px;
  color: var(--ink-3);
  margin-top: 20px;
}

/* ============================================================
   APP SHELL
   ============================================================ */

.app-shell {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

/* ── Sidebar ── */
.sidebar {
  width: var(--sidebar-w);
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow-y: auto;
  flex-shrink: 0;
  transition: transform 0.25s ease;
  z-index: 100;
}

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 20px 16px;
  border-bottom: 1px solid var(--border);
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: var(--ink);
}

.nav-logo .logo-mark { font-size: 16px; }
.nav-logo .logo-text {
  font-family: 'Playfair Display', serif;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.3px;
}

.sidebar-close {
  display: none;
  background: none;
  border: none;
  font-size: 18px;
  cursor: pointer;
  color: var(--ink-3);
  padding: 4px;
}

.sidebar-mode {
  padding: 16px 16px 8px;
}

.mode-toggle {
  display: flex;
  background: var(--bg-2);
  border-radius: 8px;
  padding: 3px;
  gap: 2px;
}

.mode-btn {
  flex: 1;
  padding: 7px 10px;
  background: transparent;
  border: none;
  border-radius: 6px;
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-3);
  cursor: pointer;
  transition: all 0.15s;
}

.mode-btn.active {
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.sidebar-nav {
  padding: 8px 12px;
  flex: 1;
}

.sidebar-nav-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-3);
  padding: 8px 8px 4px;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: 8px;
  text-decoration: none;
  color: var(--ink-2);
  font-size: 14px;
  font-weight: 500;
  transition: all 0.15s;
  margin-bottom: 2px;
}

.sidebar-link svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  opacity: 0.7;
}

.sidebar-link:hover {
  background: var(--bg-2);
  color: var(--ink);
}

.sidebar-link.active {
  background: var(--ink);
  color: #fff;
}

.sidebar-link.active svg { opacity: 1; }

.sidebar-count {
  margin-left: auto;
  background: var(--bg-2);
  color: var(--ink-2);
  font-size: 11px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 20px;
  min-width: 22px;
  text-align: center;
}

.sidebar-link.active .sidebar-count {
  background: rgba(255,255,255,0.2);
  color: #fff;
}

.sidebar-profile {
  padding: 16px;
  border-top: 1px solid var(--border);
  margin-top: auto;
}

.profile-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 4px 0;
}

.profile-label {
  font-size: 12px;
  color: var(--ink-3);
}

.profile-val {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
}

.profile-edit-btn {
  width: 100%;
  margin-top: 10px;
  padding: 8px 12px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 7px;
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-2);
  cursor: pointer;
  transition: all 0.15s;
}

.profile-edit-btn:hover {
  background: var(--border);
  color: var(--ink);
}

.profile-signout-btn {
  margin-top: 6px;
  color: var(--ink-3);
  font-size: 12px;
}

/* ── Main content ── */
.app-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-width: 0;
}

/* ── Topbar ── */
.app-topbar {
  height: var(--topbar-h);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 20px;
  flex-shrink: 0;
}

.topbar-menu-btn {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
  color: var(--ink-2);
}

.topbar-menu-btn svg { width: 20px; height: 20px; }

.topbar-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--ink);
  flex: 1;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.topbar-user {
  font-size: 13px;
  color: var(--ink-3);
  font-weight: 500;
}

.topbar-add-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  padding: 8px 14px;
}

.topbar-add-btn svg { width: 14px; height: 14px; }

/* ── Panels ── */
.panel {
  display: none;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.panel.active { display: flex; flex-direction: column; }

.panel-inner {
  padding: 24px;
  max-width: 1200px;
}

.panel-header {
  margin-bottom: 24px;
}

.panel-header h2 {
  font-family: 'Playfair Display', serif;
  font-size: 24px;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 6px;
}

.panel-header p {
  font-size: 14px;
  color: var(--ink-3);
}

/* ── Add property bar ── */
.add-property-bar {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 20px;
  box-shadow: var(--shadow);
}

.add-bar-inner {
  display: flex;
  align-items: center;
  gap: 10px;
}

.paste-icon {
  width: 18px;
  height: 18px;
  color: var(--ink-3);
  flex-shrink: 0;
}

.add-bar-input {
  flex: 1;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  color: var(--ink);
  background: var(--bg);
  outline: none;
  transition: border-color 0.15s;
}

.add-bar-input:focus { border-color: var(--ink); }

.add-bar-cancel {
  background: none;
  border: none;
  font-size: 16px;
  cursor: pointer;
  color: var(--ink-3);
  padding: 6px;
  transition: color 0.15s;
}

.add-bar-cancel:hover { color: var(--ink); }

.add-bar-status {
  font-size: 13px;
  margin-top: 10px;
  padding: 0 4px;
  color: var(--ink-3);
}

.add-bar-status.loading { color: var(--amber); }
.add-bar-status.error { color: var(--red); }

/* ── Add bar hint / paste toggle ── */
.add-bar-hint {
  font-size: 12px;
  color: var(--ink-3);
  margin-top: 8px;
  padding: 0 4px;
}
.add-bar-hint a,
.add-bar-link {
  color: var(--ink-2);
  text-decoration: underline;
  cursor: pointer;
  background: none;
  border: none;
  font: inherit;
  font-size: 12px;
  padding: 0;
}
.add-bar-link:hover { color: var(--ink); }

/* ── Add bar steps ── */
.add-bar-step {
  padding: 16px 20px;
}
#addBarStepPaste {
  border-top: 1px solid var(--border);
  background: var(--surface-2);
}

/* ── Paste step ── */
.paste-step-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.paste-step-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
}
.paste-step-instructions {
  font-size: 12px;
  color: var(--ink-3);
  margin-bottom: 12px;
  line-height: 1.5;
}
.paste-step-instructions strong { color: var(--ink-2); }
.paste-fields {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 12px;
}
.paste-textarea {
  width: 100%;
  min-height: 110px;
  max-height: 220px;
  resize: vertical;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  font-family: inherit;
  font-size: 13px;
  color: var(--ink);
  background: var(--surface);
  line-height: 1.5;
  outline: none;
  transition: border-color 0.15s;
}
.paste-textarea:focus { border-color: var(--ink); }
.paste-textarea::placeholder { color: var(--ink-3); }

/* ── Paste step (legacy selectors kept for compat) ── */
.add-bar-step-paste {
  display: none;
  padding: 16px 20px 20px;
  border-top: 1px solid var(--border);
  background: var(--surface-2);
}
.add-bar-step-paste .paste-step-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.add-bar-step-paste .paste-step-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
}
.add-bar-step-paste .paste-step-back {
  font-size: 12px;
  color: var(--ink-3);
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
  text-decoration: underline;
}
.add-bar-step-paste .paste-step-back:hover { color: var(--ink); }
.add-bar-step-paste .paste-step-instructions {
  font-size: 12px;
  color: var(--ink-3);
  margin-bottom: 10px;
  line-height: 1.5;
}
.add-bar-step-paste .paste-step-instructions strong { color: var(--ink-2); }
.paste-url-row {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
}
.paste-url-row .add-bar-input {
  flex: 1;
  font-size: 12px;
}
#pasteListingText {
  width: 100%;
  min-height: 120px;
  max-height: 240px;
  resize: vertical;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  font-family: inherit;
  font-size: 13px;
  color: var(--ink);
  background: var(--surface);
  line-height: 1.5;
  outline: none;
  transition: border-color 0.15s;
  margin-bottom: 10px;
}
#pasteListingText:focus { border-color: var(--ink); }
#pasteListingText::placeholder { color: var(--ink-3); }
.paste-step-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}
#pasteBarStatus {
  font-size: 12px;
  color: var(--ink-3);
  flex: 1;
}

/* ── Property cards grid ── */
.properties-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
}

.property-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
  box-shadow: var(--shadow);
}

.property-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.card-image-wrap {
  position: relative;
  height: 200px;
  overflow: hidden;
  background: var(--bg-2);
}

.card-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s;
}

.property-card:hover .card-image { transform: scale(1.03); }

.card-score {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  border: 2px solid rgba(255,255,255,0.9);
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.score-high { background: var(--green); color: #fff; }
.score-mid  { background: var(--amber); color: #fff; }
.score-low  { background: var(--red); color: #fff; }

.card-badges {
  position: absolute;
  top: 12px;
  left: 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.portal-badge {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 3px 7px;
  border-radius: 4px;
  background: rgba(0,0,0,0.65);
  color: #fff;
  backdrop-filter: blur(4px);
}

.portal-rightmove { background: rgba(0, 100, 200, 0.8); }
.portal-zoopla    { background: rgba(80, 0, 160, 0.8); }
.portal-onthemarket { background: rgba(0, 120, 80, 0.8); }

.tenure-badge {
  font-size: 10px;
  font-weight: 600;
  padding: 3px 7px;
  border-radius: 4px;
  backdrop-filter: blur(4px);
}

.tenure-lease { background: rgba(180, 83, 9, 0.85); color: #fff; }
.tenure-free  { background: rgba(45, 106, 79, 0.85); color: #fff; }

.card-photo-count {
  position: absolute;
  bottom: 10px;
  right: 10px;
  font-size: 11px;
  background: rgba(0,0,0,0.6);
  color: #fff;
  padding: 3px 8px;
  border-radius: 20px;
  backdrop-filter: blur(4px);
}

.card-body {
  padding: 16px;
}

.price-unknown {
  color: var(--ink-3);
  font-style: italic;
  font-size: 14px;
  font-weight: 400;
}

.card-price {
  font-size: 20px;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 4px;
  font-family: 'Playfair Display', serif;
}

.card-address {
  font-size: 13px;
  color: var(--ink-2);
  margin-bottom: 10px;
  line-height: 1.4;
}

.card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
}

.card-meta span {
  font-size: 12px;
  color: var(--ink-3);
  background: var(--bg-2);
  padding: 3px 8px;
  border-radius: 20px;
}

.card-epc {
  font-size: 12px;
  color: var(--ink-3);
  display: flex;
  align-items: center;
  gap: 6px;
}

.epc-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
  color: #fff;
}

.epc-a { background: #008054; }
.epc-b { background: #19b459; }
.epc-c { background: #8dce46; color: #333; }
.epc-d { background: #ffd500; color: #333; }
.epc-e { background: #fcaa65; color: #333; }
.epc-f { background: #ef8023; }
.epc-g { background: #e9153b; }

.card-actions {
  display: flex;
  gap: 8px;
  padding: 12px 16px;
  border-top: 1px solid var(--border);
  background: var(--surface-2);
}

.card-action-btn {
  flex: 1;
  padding: 8px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 7px;
  font-family: 'DM Sans', sans-serif;
  font-size: 12px;
  font-weight: 500;
  color: var(--ink-2);
  cursor: pointer;
  transition: all 0.15s;
}

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

.card-action-remove:hover {
  background: var(--red);
  border-color: var(--red);
  color: #fff;
}

/* ── Empty state ── */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 80px 24px;
  text-align: center;
  gap: 12px;
}

.empty-icon { font-size: 48px; }

.empty-state h3 {
  font-family: 'Playfair Display', serif;
  font-size: 22px;
  color: var(--ink);
}

.empty-state p {
  font-size: 14px;
  color: var(--ink-3);
  max-width: 320px;
}

/* ============================================================
   MODALS
   ============================================================ */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 500;
  padding: 20px;
  backdrop-filter: blur(2px);
}

.modal {
  background: var(--surface);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
}

.modal-wide { max-width: 780px; }

.modal-circumstances { max-width: 600px; }

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: var(--surface);
  z-index: 1;
}

.modal-header h3 {
  font-family: 'Playfair Display', serif;
  font-size: 18px;
  font-weight: 700;
  color: var(--ink);
}

.modal-close {
  background: none;
  border: none;
  font-size: 18px;
  cursor: pointer;
  color: var(--ink-3);
  padding: 4px 8px;
  border-radius: 6px;
  transition: all 0.15s;
}

.modal-close:hover {
  background: var(--bg-2);
  color: var(--ink);
}

.modal-body {
  padding: 24px;
}

/* ── Property detail modal ── */
.modal-gallery {
  margin-bottom: 20px;
  border-radius: var(--radius);
  overflow: hidden;
}

.gallery-main {
  height: 320px;
  overflow: hidden;
  background: var(--bg-2);
}

.gallery-main img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: opacity 0.2s;
}

.gallery-thumbs {
  display: flex;
  gap: 6px;
  padding: 8px 0 0;
  overflow-x: auto;
  scrollbar-width: none;
}

.gallery-thumbs::-webkit-scrollbar { display: none; }

.gallery-thumb {
  width: 72px;
  height: 52px;
  object-fit: cover;
  border-radius: 6px;
  cursor: pointer;
  opacity: 0.6;
  transition: opacity 0.15s;
  flex-shrink: 0;
  border: 2px solid transparent;
}

.gallery-thumb:hover { opacity: 0.85; }
.gallery-thumb.active { opacity: 1; border-color: var(--ink); }

.modal-no-image {
  height: 200px;
  background: var(--bg-2);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-3);
  font-size: 14px;
  margin-bottom: 20px;
}

.modal-price-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.modal-price {
  font-family: 'Playfair Display', serif;
  font-size: 28px;
  font-weight: 700;
  color: var(--ink);
}

.modal-score {
  font-size: 14px;
  font-weight: 700;
  padding: 6px 14px;
  border-radius: 20px;
  color: #fff;
}

.modal-meta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 10px;
  margin-bottom: 20px;
}

.modal-meta-item {
  background: var(--bg-2);
  border-radius: 8px;
  padding: 10px 12px;
}

.meta-label {
  display: block;
  font-size: 11px;
  color: var(--ink-3);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 3px;
}

.meta-val {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
}

/* ── Modal section title ── */
.modal-section-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--ink-3);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  margin: 0 0 12px 0;
}

/* ── Key Information section ── */
.modal-key-info {
  margin-bottom: 24px;
  padding: 16px;
  background: var(--surface-2);
  border-radius: 10px;
  border: 1px solid var(--border);
}

.key-info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.key-info-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.key-info-icon {
  font-size: 18px;
  line-height: 1;
  flex-shrink: 0;
  margin-top: 1px;
}

.key-info-content {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.key-info-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--ink-3);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.key-info-val {
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-1);
  word-break: break-word;
}

.key-info-mobile {
  grid-column: 1 / -1;
}

/* Mobile signal bars */
.mobile-signal-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.mobile-carrier {
  display: flex;
  align-items: center;
  gap: 4px;
}

.carrier-name {
  font-size: 11px;
  font-weight: 600;
  color: var(--ink-2);
  min-width: 44px;
}

.carrier-bars {
  font-size: 11px;
  letter-spacing: 1px;
  color: var(--accent);
}

.meta-na {
  color: var(--ink-3);
}

/* ── Features & description section ── */
.modal-features {
  margin-bottom: 24px;
}

.features-list {
  list-style: none;
  padding: 0;
  margin: 0 0 12px 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px 16px;
}

.features-list li {
  font-size: 13px;
  color: var(--ink-2);
  padding-left: 14px;
  position: relative;
  line-height: 1.4;
}

.features-list li::before {
  content: '✓';
  position: absolute;
  left: 0;
  color: var(--accent);
  font-size: 11px;
  font-weight: 700;
  top: 1px;
}

.modal-desc-text {
  font-size: 13px;
  color: var(--ink-2);
  line-height: 1.65;
  margin: 0;
}

/* Legacy .modal-description kept for compatibility */
.modal-description {
  margin-bottom: 20px;
}

.modal-description h4 {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-2);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.modal-description p {
  font-size: 14px;
  color: var(--ink-2);
  line-height: 1.6;
}

.modal-notes {
  margin-bottom: 20px;
}

.modal-notes h4 {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-2);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.modal-actions-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.modal-actions-row .btn-secondary,
.modal-actions-row .btn-primary {
  flex: 1;
  min-width: 120px;
  text-align: center;
  font-size: 13px;
  padding: 10px 14px;
}

/* ── Circumstances modal ── */
.circumstances-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
}

.circ-tab {
  flex: 1;
  padding: 10px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  font-weight: 500;
  color: var(--ink-2);
  cursor: pointer;
  transition: all 0.15s;
}

.circ-tab.active {
  background: var(--ink);
  color: #fff;
  border-color: var(--ink);
}

.circ-section-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-3);
  margin: 20px 0 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

.field-row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

/* ── Offer email modal ── */
.offer-email-box {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px;
  font-size: 13px;
  line-height: 1.7;
  color: var(--ink-2);
  white-space: pre-wrap;
  font-family: 'DM Sans', sans-serif;
  max-height: 400px;
  overflow-y: auto;
}

/* ============================================================
   FORM ELEMENTS (shared)
   ============================================================ */

.field-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-2);
}

.field-input,
.field-select,
.field-textarea {
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  color: var(--ink);
  background: var(--surface);
  outline: none;
  transition: border-color 0.15s;
  width: 100%;
}

.field-input:focus,
.field-select:focus,
.field-textarea:focus {
  border-color: var(--ink);
}

.field-textarea {
  resize: vertical;
  min-height: 80px;
  line-height: 1.5;
}

.field-prefix-wrap {
  display: flex;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  background: var(--surface);
  transition: border-color 0.15s;
}

.field-prefix-wrap:focus-within { border-color: var(--ink); }

.field-prefix {
  padding: 10px 12px;
  background: var(--bg-2);
  color: var(--ink-3);
  font-size: 14px;
  border-right: 1px solid var(--border);
  flex-shrink: 0;
}

.field-prefix-wrap .field-input {
  border: none;
  border-radius: 0;
}

.field-prefix-wrap .field-input:focus { border: none; }

/* ── Buttons ── */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 18px;
  background: var(--ink);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s;
  text-decoration: none;
}

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

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 18px;
  background: var(--bg-2);
  color: var(--ink-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
  text-decoration: none;
}

.btn-secondary:hover {
  background: var(--border);
  color: var(--ink);
}

/* ============================================================
   COMPARE PANEL
   ============================================================ */

.compare-empty {
  padding: 60px 24px;
  text-align: center;
  color: var(--ink-3);
  font-size: 14px;
}

.compare-scroll {
  overflow-x: auto;
}

.compare-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.compare-table th,
.compare-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: middle;
}

.compare-table thead th {
  background: var(--bg-2);
  font-weight: 600;
  font-size: 12px;
  color: var(--ink-2);
  position: sticky;
  top: 0;
}

.compare-table thead th:first-child {
  min-width: 130px;
}

.compare-row-label {
  font-size: 12px;
  color: var(--ink-3);
  font-weight: 500;
  white-space: nowrap;
  background: var(--surface-2);
}

.compare-th-addr {
  font-size: 12px;
  max-width: 160px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.compare-thumb {
  width: 80px;
  height: 56px;
  object-fit: cover;
  border-radius: 6px;
}

.compare-score {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 700;
  color: #fff;
}

/* ============================================================
   CHECKLIST PANEL
   ============================================================ */

.checklist-property-select {
  margin-bottom: 20px;
  max-width: 400px;
}

.checklist-placeholder {
  padding: 40px 0;
  color: var(--ink-3);
  font-size: 14px;
}

.checklist-progress {
  margin-bottom: 24px;
}

.checklist-progress-bar {
  height: 6px;
  background: var(--bg-2);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 8px;
}

.checklist-progress-fill {
  height: 100%;
  background: var(--green);
  border-radius: 3px;
  transition: width 0.3s;
}

.checklist-progress-stats {
  display: flex;
  gap: 16px;
  font-size: 13px;
  color: var(--ink-3);
}

.checklist-issues-count {
  color: var(--amber);
  font-weight: 600;
}

.checklist-category {
  margin-bottom: 24px;
}

.checklist-cat-header {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-2);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 10px 0 8px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 8px;
}

.checklist-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border-radius: 8px;
  margin-bottom: 4px;
  transition: background 0.1s;
}

.checklist-item:hover { background: var(--bg-2); }
.checklist-item.checked { background: var(--surface-2); }

.checklist-item-text {
  font-size: 14px;
  color: var(--ink-2);
  flex: 1;
  padding-right: 12px;
}

.checklist-item-actions {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}

.check-btn {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: 14px;
  cursor: pointer;
  transition: all 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-3);
}

.check-ok.active  { background: var(--green-bg); border-color: var(--green); color: var(--green); }
.check-issue.active { background: var(--amber-bg); border-color: var(--amber); color: var(--amber); }
.check-na.active  { background: var(--bg-2); border-color: var(--border-2); color: var(--ink-3); }

/* ============================================================
   COSTS PANEL
   ============================================================ */

.costs-layout {
  display: grid;
  grid-template-columns: 340px 1fr;
  gap: 24px;
  align-items: start;
}

.costs-form {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.costs-results {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.costs-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}

.costs-section h4 {
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-3);
  margin-bottom: 14px;
}

.costs-breakdown {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.cost-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 14px;
  color: var(--ink-2);
  padding: 4px 0;
}

.cost-total {
  border-top: 1px solid var(--border);
  padding-top: 10px;
  margin-top: 4px;
  font-weight: 700;
  color: var(--ink);
  font-size: 15px;
}

.costs-disclaimer {
  font-size: 12px;
  color: var(--ink-3);
  font-style: italic;
  padding: 12px 16px;
  background: var(--bg-2);
  border-radius: 8px;
}

/* ============================================================
   NEGOTIATE PANEL
   ============================================================ */

.negotiate-layout {
  display: grid;
  grid-template-columns: 340px 1fr;
  gap: 24px;
  align-items: start;
}

.negotiate-form {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.negotiate-placeholder {
  padding: 40px 24px;
  color: var(--ink-3);
  font-size: 14px;
}

.neg-results {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.neg-leverage-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.neg-leverage-label {
  font-size: 14px;
  color: var(--ink-2);
  font-weight: 500;
}

.neg-leverage-badge {
  font-size: 13px;
  font-weight: 700;
  padding: 5px 14px;
  border-radius: 20px;
}

.leverage-strong { background: var(--green-bg); color: var(--green); }
.leverage-mid    { background: var(--amber-bg); color: var(--amber); }
.leverage-weak   { background: var(--red-bg); color: var(--red); }

.neg-offers {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.neg-offer-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  text-align: center;
}

.neg-opening { border-top: 3px solid var(--green); }
.neg-second  { border-top: 3px solid var(--amber); }
.neg-ceiling { border-top: 3px solid var(--red); }

.neg-offer-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-3);
  margin-bottom: 8px;
}

.neg-offer-price {
  font-family: 'Playfair Display', serif;
  font-size: 22px;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 4px;
}

.neg-offer-saving {
  font-size: 12px;
  color: var(--green);
  font-weight: 500;
}

.neg-rationale,
.neg-tactics {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
}

.neg-rationale h4,
.neg-tactics h4 {
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-3);
  margin-bottom: 12px;
}

.neg-rationale ul,
.neg-tactics ul {
  padding-left: 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.neg-rationale li,
.neg-tactics li {
  font-size: 14px;
  color: var(--ink-2);
  line-height: 1.5;
}

/* ============================================================
   AI ANALYST PANEL
   ============================================================ */

.analyst-layout {
  display: flex;
  flex-direction: column;
  height: calc(100vh - var(--topbar-h) - 120px);
  gap: 12px;
}

.analyst-property-select {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.analyst-property-select .field-label {
  white-space: nowrap;
  font-size: 13px;
}

.analyst-property-select .field-select {
  max-width: 320px;
}

.analyst-chat {
  flex: 1;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.analyst-welcome {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.analyst-avatar {
  width: 36px;
  height: 36px;
  background: var(--ink);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  flex-shrink: 0;
}

.analyst-welcome-text strong {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 4px;
}

.analyst-welcome-text p {
  font-size: 13px;
  color: var(--ink-3);
  line-height: 1.5;
}

.analyst-messages {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.analyst-message {
  display: flex;
}

.analyst-user { justify-content: flex-end; }
.analyst-analyst { justify-content: flex-start; }

.analyst-bubble {
  max-width: 75%;
  padding: 12px 16px;
  border-radius: 12px;
  font-size: 14px;
  line-height: 1.6;
}

.analyst-user .analyst-bubble {
  background: var(--ink);
  color: #fff;
  border-bottom-right-radius: 4px;
}

.analyst-analyst .analyst-bubble {
  background: var(--bg-2);
  color: var(--ink-2);
  border-bottom-left-radius: 4px;
}

.analyst-input-row {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.analyst-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.suggestion-chip {
  padding: 7px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  color: var(--ink-2);
  cursor: pointer;
  transition: all 0.15s;
}

.suggestion-chip:hover {
  background: var(--ink);
  color: #fff;
  border-color: var(--ink);
}

.analyst-input-wrap {
  display: flex;
  gap: 8px;
}

.analyst-input {
  flex: 1;
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  color: var(--ink);
  background: var(--surface);
  outline: none;
  transition: border-color 0.15s;
}

.analyst-input:focus { border-color: var(--ink); }

.analyst-send-btn {
  width: 44px;
  height: 44px;
  background: var(--ink);
  border: none;
  border-radius: 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
  flex-shrink: 0;
}

.analyst-send-btn:hover { background: var(--accent-hover); }
.analyst-send-btn svg { width: 18px; height: 18px; color: #fff; }

/* ============================================================
   TOAST
   ============================================================ */

.hb-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(80px);
  background: var(--ink);
  color: #fff;
  padding: 12px 24px;
  border-radius: 24px;
  font-size: 14px;
  font-weight: 500;
  z-index: 9999;
  transition: transform 0.25s ease;
  pointer-events: none;
  white-space: nowrap;
  box-shadow: var(--shadow-lg);
}

.hb-toast.show {
  transform: translateX(-50%) translateY(0);
}

/* ============================================================
   STATS BAR
   ============================================================ */

.properties-stats-bar {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 16px;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  text-align: center;
}

.stat-card-val {
  font-family: 'Playfair Display', serif;
  font-size: 20px;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.stat-card-label {
  font-size: 11px;
  color: var(--ink-3);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-top: 3px;
}

/* ============================================================
   FILTER / SORT TOOLBAR
   ============================================================ */

.properties-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.toolbar-sort {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.toolbar-sort-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-3);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.toolbar-sort-select {
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px 10px;
  cursor: pointer;
  outline: none;
}

.toolbar-sort-select:focus {
  border-color: var(--accent);
}

.toolbar-divider {
  width: 1px;
  height: 24px;
  background: var(--border);
  flex-shrink: 0;
}

.filter-chips {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.filter-chip {
  padding: 5px 12px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: var(--surface);
  font-family: 'DM Sans', sans-serif;
  font-size: 12px;
  font-weight: 500;
  color: var(--ink-2);
  cursor: pointer;
  transition: all 0.15s;
}

.filter-chip:hover {
  border-color: var(--ink-2);
  color: var(--ink);
}

.filter-chip.active {
  background: var(--ink);
  border-color: var(--ink);
  color: #fff;
}

.toolbar-count {
  font-size: 12px;
  color: var(--ink-3);
  margin-left: auto;
}

/* ============================================================
   CARD ENHANCEMENTS
   ============================================================ */

.card-price-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 4px;
}

.card-ppsf {
  font-size: 11px;
  color: var(--ink-3);
  font-weight: 400;
}

.card-days {
  font-size: 11px;
  color: var(--ink-3);
  margin-bottom: 4px;
}

.card-status-badge {
  position: absolute;
  bottom: 8px;
  left: 8px;
  padding: 3px 8px;
  border-radius: 12px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.03em;
  backdrop-filter: blur(4px);
}

.status-badge-shortlisted { background: rgba(255,193,7,0.9); color: #333; }
.status-badge-viewing { background: rgba(33,150,243,0.9); color: #fff; }
.status-badge-offer { background: rgba(76,175,80,0.9); color: #fff; }
.status-badge-rejected { background: rgba(244,67,54,0.85); color: #fff; }

.property-card.status-rejected {
  opacity: 0.65;
}

.property-card.status-offer {
  box-shadow: 0 0 0 2px #4caf50, var(--shadow);
}

.property-card.status-shortlisted {
  box-shadow: 0 0 0 2px #ffc107, var(--shadow);
}

/* ============================================================
   MODAL ENHANCEMENTS
   ============================================================ */

.modal-ppsf {
  font-size: 14px;
  font-weight: 400;
  color: var(--ink-3);
  margin-left: 10px;
  font-family: 'DM Sans', sans-serif;
}

.modal-days-listed {
  font-size: 12px;
  color: var(--ink-3);
  margin-top: 2px;
}

.modal-status-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  padding: 10px 14px;
  background: var(--surface-2);
  border-radius: 8px;
  border: 1px solid var(--border);
}

.modal-status-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-3);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  flex-shrink: 0;
}

.modal-status-select {
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 7px;
  padding: 6px 10px;
  cursor: pointer;
  outline: none;
  flex: 1;
}

.modal-status-select:focus {
  border-color: var(--accent);
}

/* ============================================================
   CHECKLIST REPORT MODAL
   ============================================================ */

.report-summary-stats {
  display: flex;
  gap: 12px;
}

.report-stat {
  flex: 1;
  text-align: center;
  padding: 14px 10px;
  border-radius: 10px;
  border: 1px solid var(--border);
}

.report-stat span {
  display: block;
  font-family: 'Playfair Display', serif;
  font-size: 28px;
  font-weight: 700;
  line-height: 1;
}

.report-stat small {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-3);
  margin-top: 4px;
  display: block;
}

.report-stat-ok { background: #f0fdf4; border-color: #bbf7d0; }
.report-stat-ok span { color: #16a34a; }
.report-stat-issue { background: #fff7ed; border-color: #fed7aa; }
.report-stat-issue span { color: #ea580c; }
.report-stat-na { background: var(--surface-2); }
.report-stat-na span { color: var(--ink-2); }

.report-category {
  margin-bottom: 14px;
  padding: 12px 14px;
  background: #fff7ed;
  border-radius: 8px;
  border: 1px solid #fed7aa;
}

.report-cat-name {
  font-size: 13px;
  font-weight: 700;
  color: #ea580c;
  margin-bottom: 8px;
}

.report-category ul {
  margin: 0;
  padding-left: 18px;
}

.report-category li {
  font-size: 13px;
  color: var(--ink-2);
  margin-bottom: 4px;
  line-height: 1.4;
}

.report-all-clear {
  padding: 16px;
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: 8px;
  color: #16a34a;
  font-size: 14px;
  font-weight: 600;
  text-align: center;
}

/* ============================================================
   DEMO BUTTON + FILTER EMPTY
   ============================================================ */

.btn-demo {
  background: none;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  padding: 10px 20px;
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  color: var(--ink-3);
  cursor: pointer;
  transition: all 0.15s;
}

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

.filter-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 48px 24px;
  color: var(--ink-3);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.filter-empty p {
  font-size: 14px;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */

@media (max-width: 900px) {
  .costs-layout,
  .negotiate-layout {
    grid-template-columns: 1fr;
  }

  .neg-offers {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    transform: translateX(-100%);
    box-shadow: var(--shadow-lg);
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .sidebar-close { display: block; }
  .topbar-menu-btn { display: flex; }

  .properties-grid {
    grid-template-columns: 1fr;
  }

  .modal-wide { max-width: 100%; }

  .gallery-main { height: 220px; }

  .modal-meta-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .field-row-2 {
    grid-template-columns: 1fr;
  }

  .analyst-layout {
    height: auto;
  }

  .analyst-chat {
    min-height: 300px;
  }

  .topbar-user { display: none; }
}

/* ── Sold Prices Panel ── */

.sp-search-bar {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 24px;
}

.sp-search-wrap {
  display: flex;
  gap: 8px;
  align-items: center;
}

.sp-search-input {
  flex: 1;
  padding: 10px 14px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  background: var(--surface);
  color: var(--ink);
  transition: border-color 0.15s;
}
.sp-search-input:focus {
  outline: none;
  border-color: var(--accent);
}

.sp-search-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.sp-property-shortcuts {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.sp-shortcut-chip {
  padding: 5px 12px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 20px;
  font-size: 12px;
  font-family: 'DM Sans', sans-serif;
  color: var(--ink-2);
  cursor: pointer;
  transition: all 0.15s;
}
.sp-shortcut-chip:hover {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.sp-empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--ink-3);
}
.sp-empty-icon { width: 40px; height: 40px; margin: 0 auto 12px; color: var(--ink-3); }
.sp-empty-sub { font-size: 13px; margin-top: 6px; }

.sp-loading {
  text-align: center;
  padding: 40px;
  color: var(--ink-3);
  font-size: 14px;
}

.sp-error {
  background: #fff7ed;
  border: 1px solid #fed7aa;
  border-radius: 8px;
  padding: 16px 20px;
  color: #9a3412;
  font-size: 14px;
}

.sp-results-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 16px;
  flex-wrap: wrap;
  gap: 8px;
}
.sp-results-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--ink);
}
.sp-results-meta {
  font-size: 13px;
  color: var(--ink-3);
}

.sp-summary-bar {
  display: flex;
  gap: 12px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.sp-summary-stat {
  flex: 1;
  min-width: 120px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 16px;
  text-align: center;
}
.sp-summary-stat-val {
  font-size: 20px;
  font-weight: 700;
  color: var(--ink);
  font-family: 'Playfair Display', serif;
}
.sp-summary-stat-label {
  font-size: 11px;
  color: var(--ink-3);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 2px;
}

.sp-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 10px;
}
.sp-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.sp-table th {
  background: var(--surface-2);
  padding: 10px 14px;
  text-align: left;
  font-weight: 600;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ink-3);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.sp-table td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  color: var(--ink);
  vertical-align: middle;
}
.sp-table tr:last-child td { border-bottom: none; }
.sp-table tr:hover td { background: var(--surface-2); }

.sp-price-cell {
  font-weight: 600;
  color: var(--ink);
}
.sp-type-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 500;
  background: var(--surface-2);
  color: var(--ink-2);
}
.sp-new-build { background: #eff6ff; color: #1d4ed8; }
.sp-tenure-badge {
  font-size: 11px;
  color: var(--ink-3);
}

/* Filter chips */
.sp-filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 12px 0 4px;
}
.sp-filter-chip {
  padding: 4px 12px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--ink-2);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
}
.sp-filter-chip:hover { border-color: var(--accent); color: var(--accent); }
.sp-filter-chip.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

/* Type badge colour variants */
.sp-type-d { background: #f0fdf4; color: #15803d; }
.sp-type-s { background: #eff6ff; color: #1d4ed8; }
.sp-type-t { background: #fdf4ff; color: #7e22ce; }
.sp-type-f { background: #fff7ed; color: #c2410c; }
.sp-type-o { background: var(--surface-2); color: var(--ink-2); }

/* Tenure badge colour variants */
.sp-tenure-badge { display: inline-block; padding: 2px 7px; border-radius: 4px; font-size: 11px; font-weight: 500; }
.sp-tenure-f { background: #f0fdf4; color: #15803d; }
.sp-tenure-l { background: #fff7ed; color: #c2410c; }
.sp-tenure-u { background: var(--surface-2); color: var(--ink-3); }

/* New build badge */
.sp-new-badge {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 600;
  background: #eff6ff;
  color: #1d4ed8;
  margin-left: 4px;
  vertical-align: middle;
  letter-spacing: 0.02em;
}

/* Table cell helpers */
.sp-addr-cell { font-size: 13px; color: var(--ink); max-width: 220px; }
.sp-date-cell { font-size: 12px; color: var(--ink-3); white-space: nowrap; }
.sp-badges-cell { white-space: nowrap; }

/* No filter results */
.sp-no-filter-results {
  text-align: center;
  padding: 24px;
  color: var(--ink-3);
  font-size: 13px;
}

/* Source note */
.sp-source-note {
  font-size: 11px;
  color: var(--ink-3);
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.sp-no-results {
  text-align: center;
  padding: 40px;
  color: var(--ink-3);
  font-size: 14px;
}

@media (max-width: 480px) {
  .sp-summary-stat { min-width: 100px; }
  .sp-table th, .sp-table td { padding: 8px 10px; }
  .sp-addr-cell { max-width: 140px; }
}

/* ── End Sold Prices ── */

@media (max-width: 480px) {
  .panel-inner { padding: 16px; }
  .auth-card { padding: 28px 20px; }
  .modal-body { padding: 16px; }
  .modal-actions-row { flex-direction: column; }
  .modal-actions-row .btn-secondary,
  .modal-actions-row .btn-primary { width: 100%; }
}
