/* RealEZ — layout & component classes beyond what Bulma ships. */

h1 { font-family: var(--font-serif); }

.app-shell {
  display: flex;
  min-height: 100vh;
}
.app-shell.is-public {
  flex-direction: column;
}
.app-shell.is-public .app-main {
  background: var(--realez-app-bg);
}

.app-sidebar {
  width: 240px;
  flex-shrink: 0;
  background: var(--surface);
  border-right: 1px solid var(--border);
  padding: 1.25rem 1rem;
}

.app-sidebar .wordmark {
  font-weight: 800;
  font-size: 1.15rem;
  letter-spacing: -0.01em;
  color: var(--bulma-primary);
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.45rem;
}
.app-sidebar .wordmark .accent { color: var(--realez-secondary); }
.wordmark-icon { height: 1.35rem; width: auto; }

.app-main {
  flex: 1;
  min-width: 0;
  /* Top padding clears .top-bar-actions (fixed, top:0.85rem, ~2.4rem tall)
     so a page-header's right-aligned actions (a status badge, a "Download"
     button) never sit underneath the theme toggle / notification bell. */
  padding: 3.5rem 2rem 1.75rem;
}

.hairline-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.25rem;
}

.page-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.page-header h1 {
  font-family: var(--font-serif);
  font-size: 1.9rem;
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.01em;
  color: var(--text-strong);
}

/* Status badges reused across document checklists, tracking dashboards, transaction lists —
   a small squared-off label (not a pill) with a solid accent-colored left edge, closer to a
   manifest/shipping tag than a rounded chat-bubble. */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35em;
  padding: 0.2em 0.65em;
  border-radius: 2px;
  border-left: 3px solid currentColor;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.01em;
}
.status-badge.status-not_started { background: var(--border-soft); color: var(--text-tertiary); }
.status-badge.status-sent { background: var(--realez-secondary-lite); color: var(--revenue-text); }
.status-badge.status-partially_signed { background: var(--badge-warning-bg); color: var(--badge-warning-text); }
.status-badge.status-signed { background: var(--badge-success-bg); color: var(--badge-success-text); }
.status-badge.status-active { background: var(--badge-info-bg); color: var(--badge-info-text); }
.status-badge.status-closed { background: var(--badge-success-bg); color: var(--badge-success-text); }
.status-badge.status-cancelled { background: var(--badge-danger-bg); color: var(--badge-danger-text); }
.status-badge.status-declined { background: var(--badge-danger-bg); color: var(--badge-danger-text); }
.status-badge.status-in_progress { background: var(--badge-warning-bg); color: var(--badge-warning-text); }
.status-badge.status-complete { background: var(--badge-success-bg); color: var(--badge-success-text); }
.status-badge.status-pending { background: var(--badge-info-bg); color: var(--badge-info-text); }
.status-badge.status-countered { background: var(--badge-warning-bg); color: var(--badge-warning-text); }
.status-badge.status-accepted { background: var(--badge-success-bg); color: var(--badge-success-text); }
.status-badge.status-rejected { background: var(--badge-danger-bg); color: var(--badge-danger-text); }

.table.is-hairline td, .table.is-hairline th {
  border-color: var(--border-soft);
}

/* Every data table on the site sits in one of these wrappers. overflow-x
   alone doesn't help on a narrow screen: table-layout:auto just shrinks and
   wraps cell text to fit instead of scrolling, which is how these tables
   were reading as illegibly cramped on phones. nowrap forces the table back
   to its natural width so the scroll actually engages. Desktop is unaffected
   since these tables already fit their container there. */
.table-scroll { overflow-x: auto; padding: 0; -webkit-overflow-scrolling: touch; }
@media (max-width: 768px) {
  .table-scroll .table td, .table-scroll .table th { white-space: nowrap; }
}

/* Bulma's default table text color comes from its own scheme variables, which
   were never re-derived to match the charcoal/gray palette custom.css uses
   everywhere else (headings, card text) — the mismatch reads as an
   inconsistent, too-harsh black next to the rest of the page. Align it. */
.table td, .table th { color: var(--text); }
.table th { color: var(--text-strong); font-weight: 700; }

.plain-list { list-style: none; margin: 0; padding: 0; }

/* ---------------------------------------------------------------- Sidebar nav */

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  margin-bottom: 1.5rem;
}

.sidebar-nav-link {
  display: block;
  padding: 0.55rem 0.75rem;
  border-radius: 6px;
  color: var(--text-secondary);
  font-weight: 500;
  font-size: 0.92rem;
}
.sidebar-nav-link:hover { background: var(--surface-alt); color: var(--text-strong); }
.sidebar-nav-link.is-active {
  background: var(--realez-primary-lite);
  color: var(--bulma-primary);
  font-weight: 700;
}

.sidebar-identity {
  margin-top: auto;
  padding-top: 1rem;
  border-top: 1px solid var(--border-soft);
  position: absolute;
  bottom: 1.25rem;
  left: 1rem;
  right: 1rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}
.sidebar-identity-text { min-width: 0; }
.sidebar-identity-name {
  font-weight: 600;
  font-size: 0.88rem;
  color: var(--text-strong);
  margin-bottom: 0.3rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sidebar-identity-actions {
  display: flex;
  gap: 0.75rem;
  font-size: 0.85rem;
  font-weight: 600;
}
.sidebar-identity-actions a { color: var(--bulma-primary); text-decoration: underline; }
.sidebar-identity-actions a:hover { color: var(--text-strong); }
.sidebar-logout-form { display: inline; margin: 0; }
.sidebar-logout-button {
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-strong);
  text-decoration: underline;
  cursor: pointer;
}
.sidebar-logout-button:hover { color: var(--bulma-danger); }

.app-sidebar { position: relative; padding-bottom: 5.5rem; }

.drawer-toggle {
  display: none;
  position: fixed;
  top: 0.85rem;
  left: 1rem;
  z-index: 30;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  width: 2.25rem;
  height: 2.25rem;
  font-size: 1.1rem;
  cursor: pointer;
}

@media (max-width: 768px) {
  .drawer-toggle { display: block; }
  .app-sidebar {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 20;
    transform: translateX(-100%);
    transition: transform 0.18s ease;
    box-shadow: 2px 0 12px rgba(0, 0, 0, 0.08);
  }
  .app-sidebar.is-open { transform: translateX(0); }
  .app-sidebar .wordmark { margin-left: 2.5rem; }
  .app-main { padding-top: 4rem; }
  .app-shell.has-client-tab-bar .app-main { padding-bottom: 4.5rem; }
  /* On the Client portal, the fixed bottom tab bar (z-index 25) otherwise
     sits on top of the sidebar drawer's bottom-anchored identity block
     (.sidebar-identity, z-index 20 via .app-sidebar) — hiding and blocking
     clicks on "Switch"/"Log out", the only way to change personas from
     inside the app on mobile. Push it up clear of the tab bar's height. */
  .app-shell.has-client-tab-bar .sidebar-identity { bottom: 4.5rem; }
}

/* ------------------------------------------------------------- Landing/switch */

/* Only the landing page's own content self-centers into a narrow column — the
   public .app-main itself stays full-width now that guest marketplace
   browsing (wide grids) also renders through the unauthenticated branch. */
.landing-wrap { width: 100%; max-width: 780px; margin: 0 auto; padding: 1rem 0; }

.landing-hero {
  text-align: left;
  margin-bottom: 2.25rem;
  padding-bottom: 2.25rem;
  border-bottom: 1px solid var(--border);
}
.landing-wordmark {
  font-weight: 800;
  font-size: 1.5rem;
  letter-spacing: -0.01em;
  color: var(--text-strong);
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 0.6rem;
}
.landing-wordmark .accent { color: var(--realez-secondary); }
.landing-wordmark-icon { height: 1.8rem; width: auto; }
.landing-tagline {
  font-family: var(--font-serif);
  color: var(--text-strong);
  font-size: 1.85rem;
  font-weight: 500;
  line-height: 1.25;
  letter-spacing: -0.01em;
  max-width: 34ch;
}

.landing-footer-link { text-align: left; margin-top: 2.5rem; }

.identity-group { margin-bottom: 2rem; }
.identity-group-title {
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-faint);
  margin-bottom: 0.75rem;
}

.identity-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 0.75rem;
}

.identity-card { margin: 0; height: 100%; }
.identity-card-button {
  all: unset;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  height: 100%;
  box-sizing: border-box;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.9rem 1rem;
  cursor: pointer;
}
.identity-card-button:hover { border-color: var(--bulma-primary); background: var(--realez-primary-lite); }
.identity-card.is-featured .identity-card-button { border-color: var(--realez-secondary); }
.identity-card-text { display: flex; flex-direction: column; gap: 0.3rem; min-width: 0; }
.identity-card-label { font-weight: 700; color: var(--text-strong); font-size: 0.95rem; }
.identity-card-headline { color: var(--text-muted); font-size: 0.8rem; }

/* ----------------------------------------------------------------- Avatars */

.identity-avatar {
  flex-shrink: 0;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  font-weight: 700;
  font-size: 0.85rem;
  letter-spacing: 0.02em;
}
.identity-avatar-small { width: 2rem; height: 2rem; font-size: 0.72rem; }

/* ------------------------------------------------------------------- Stats */

.stat-row { display: flex; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; }
.stat-tile { min-width: 150px; }
.stat-value { font-size: 1.75rem; font-weight: 800; color: var(--bulma-primary); }
.stat-label { color: var(--text-muted); font-size: 0.85rem; margin-top: 0.15rem; }

/* -------------------------------------------------------------- Marketplace */

.marketplace-category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
}
.marketplace-category-card { display: flex; align-items: center; gap: 0.85rem; height: 100%; box-sizing: border-box; }
.marketplace-category-card h3 { font-size: 1rem; font-weight: 700; margin-bottom: 0.3rem; }
.category-card-icon {
  flex-shrink: 0;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 999px;
  background: var(--realez-primary-lite);
  color: var(--bulma-primary);
  display: flex;
  align-items: center;
  justify-content: center;
}
.category-card-icon svg { width: 1.4rem; height: 1.4rem; }

.recommendation-rail {
  padding: 1.25rem;
  background: var(--realez-primary-lite);
  border-radius: 8px;
}
.recommendation-rail .section-title { color: var(--badge-info-text); }

.listing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1rem;
}

.listing-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.listing-tile {
  width: 100%;
  aspect-ratio: 16 / 9;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  font-weight: 800;
}
.listing-tile-large { aspect-ratio: 4 / 3; border-radius: 8px; font-size: 3rem; }
.listing-tile-icon svg { width: 2.25rem; height: 2.25rem; display: block; }
.listing-tile-icon-large svg { width: 3.5rem; height: 3.5rem; }

.listing-card-body { padding: 0.9rem 1rem; display: flex; flex-direction: column; flex: 1; gap: 0.35rem; }
.listing-card-body > button { margin-top: auto; align-self: flex-start; }
.listing-card-name { display: block; font-weight: 700; color: var(--text-strong); font-size: 0.95rem; }
.listing-card-featured-tag { font-size: 0.68rem; vertical-align: middle; margin-left: 0.4rem; }
.listing-card-tagline { font-size: 0.82rem; margin: 0.3rem 0 0.5rem; }
.listing-card-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.82rem;
  color: var(--text-muted);
}
.listing-card-price { font-weight: 700; color: var(--text-strong); }

.listing-detail-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 2rem;
  align-items: start;
}
.listing-detail-meta { color: var(--text-muted); margin-top: 0.4rem; }
@media (max-width: 700px) {
  .listing-detail-layout { grid-template-columns: 1fr; }
}

.cart-line-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--surface-alt);
}
.cart-line-item:last-child { border-bottom: none; }

.confirmation-card { max-width: 480px; text-align: center; padding: 2.5rem 2rem; }
.confirmation-card h1 { font-size: 1.4rem; margin-bottom: 0.5rem; }

/* --------------------------------------------------------------- Cart badge */

.cart-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.1rem;
  height: 1.1rem;
  padding: 0 0.3rem;
  border-radius: 999px;
  background: var(--realez-secondary);
  color: #ffffff;
  font-size: 0.68rem;
  font-weight: 700;
}

.public-header {
  display: flex;
  flex-wrap: wrap;
  row-gap: 0.5rem;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.5rem;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.public-header .wordmark { font-weight: 800; font-size: 1.1rem; color: var(--bulma-primary); display: flex; align-items: center; gap: 0.4rem; }
.public-header .wordmark .accent { color: var(--realez-secondary); }
.public-header-actions { display: flex; flex-wrap: wrap; row-gap: 0.4rem; align-items: center; gap: 1.25rem; }
.public-header-link { color: var(--text-secondary); font-size: 0.9rem; font-weight: 600; display: flex; align-items: center; gap: 0.4rem; white-space: nowrap; }
.public-header-link:hover { color: var(--bulma-primary); }
@media (max-width: 480px) {
  .public-header-actions { gap: 0.85rem; }
  .public-header-link { font-size: 0.82rem; }
}

/* ---------------------------------------------------------------- Card title */

.card-title { font-size: 0.95rem; font-weight: 700; color: var(--text-strong); margin-bottom: 0.75rem; }

/* -------------------------------------------------------------- Filter bar */

.filter-bar { display: flex; gap: 0.6rem; align-items: center; margin-bottom: 1.25rem; flex-wrap: wrap; }
.filter-bar-search { width: auto; min-width: 220px; flex: 1 1 220px; max-width: 320px; }

/* -------------------------------------------------------------- Clickable rows */

.is-clickable-row { cursor: pointer; }
.is-clickable-row:hover { background: var(--surface-hover); }

/* ------------------------------------------------------------ Property header */

.property-scene {
  width: 100%;
  aspect-ratio: 21 / 6;
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 1.25rem;
}
.property-scene svg { width: 100%; height: 100%; display: block; }

.property-thumb {
  width: 3rem;
  height: 2.25rem;
  border-radius: 6px;
  overflow: hidden;
  flex-shrink: 0;
}
.property-thumb svg { width: 100%; height: 100%; display: block; }

.property-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  flex-wrap: wrap;
}
.property-header h1 {
  font-family: var(--font-serif);
  font-size: 1.7rem;
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.01em;
  color: var(--text-strong);
}
.property-header-price { font-size: 1.5rem; font-weight: 800; color: var(--bulma-primary); white-space: nowrap; }
.property-meta {
  display: flex;
  gap: 1rem;
  color: var(--text-muted);
  font-size: 0.88rem;
  margin-top: 0.5rem;
  flex-wrap: wrap;
}

/* -------------------------------------------------------------- Stage tracker */

.stage-tracker {
  display: flex;
  align-items: center;
  margin: 1.75rem 0;
}
.stage-step {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  text-align: center;
}
.stage-step::before {
  content: "";
  position: absolute;
  top: 7px;
  left: -50%;
  width: 100%;
  height: 2px;
  background: var(--border);
  z-index: 0;
}
.stage-step:first-child::before { display: none; }
.stage-step.is-complete::before { background: var(--bulma-primary); }
.stage-step-dot {
  width: 16px;
  height: 16px;
  border-radius: 999px;
  background: var(--border);
  border: 2px solid var(--surface);
  box-shadow: 0 0 0 1px var(--border);
  z-index: 1;
}
.stage-step.is-complete .stage-step-dot { background: var(--bulma-primary); box-shadow: 0 0 0 1px var(--bulma-primary); }
.stage-step.is-current .stage-step-dot { background: var(--realez-secondary); box-shadow: 0 0 0 3px var(--realez-secondary-lite); }
.stage-step-label { font-size: 0.78rem; color: var(--text-faint); margin-top: 0.5rem; }
.stage-step.is-complete .stage-step-label, .stage-step.is-current .stage-step-label { color: var(--text-strong); font-weight: 600; }

/* ------------------------------------------------------------- Detail layout */

.detail-columns { display: grid; grid-template-columns: 1fr 300px; gap: 1.5rem; align-items: start; }
/* Grid children default to a content-based min size, not 0 — without this a
   wide child (like a data table) forces the whole grid track to grow rather
   than scroll internally, which was pushing the admin dashboard wider than
   the viewport on mobile. */
.detail-main, .detail-side { min-width: 0; }
.section-title {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 0.85rem;
  padding-bottom: 0.3rem;
  color: var(--text-muted);
  border-bottom: 2px solid var(--bulma-primary);
}
@media (max-width: 900px) {
  .detail-columns { grid-template-columns: 1fr; }
}

.parties-list { display: flex; flex-direction: column; gap: 0.6rem; }
.parties-list dt { font-size: 0.75rem; color: var(--text-faint); text-transform: uppercase; letter-spacing: 0.03em; }
.parties-list dd { font-weight: 600; color: var(--text-strong); margin: 0; }

/* ---------------------------------------------------------- Document checklist */

.checklist-stage-group { margin-bottom: 1.25rem; }
.checklist-stage-title {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-faint);
  margin-bottom: 0.5rem;
}
.checklist-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.65rem 0.9rem;
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: 8px;
  margin-bottom: 0.4rem;
  gap: 0.75rem;
}
.checklist-row:hover { border-color: var(--bulma-primary); }
.checklist-row-name {
  color: var(--text-strong);
  font-weight: 500;
  font-size: 0.92rem;
  text-decoration: none;
  flex: 1;
  min-width: 0;
}
.checklist-row-name:hover { color: var(--bulma-primary); }
.checklist-row-actions { display: flex; align-items: center; gap: 0.6rem; flex-shrink: 0; }

/* -------------------------------------------------------------- Document paper */

.document-paper { max-width: 720px; }
.closing-packet-cover, .closing-packet-doc { margin-bottom: 1.25rem; }
.document-letterhead {
  display: flex;
  justify-content: space-between;
  padding-bottom: 0.9rem;
  margin-bottom: 1rem;
  border-bottom: 1px solid var(--border-soft);
  font-size: 0.85rem;
}
.document-letterhead-brand { font-weight: 700; color: var(--bulma-primary); }
.document-body { line-height: 1.7; color: var(--text); margin-bottom: 1.25rem; }
.document-body p { margin: 0 0 1rem; }

/* Line-item breakdowns for the highest-visibility document types (Purchase
   Agreement, Closing Disclosure, Settlement Statement) — body_template
   content for these embeds real <table> markup, see document_catalog.py. */
.doc-table { width: 100%; border-collapse: collapse; margin: 1rem 0; font-size: 0.88rem; }
.doc-table th, .doc-table td { text-align: left; padding: 0.5rem 0.6rem; border-bottom: 1px solid var(--border-soft); }
.doc-table th { color: var(--text-faint); font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.03em; font-weight: 700; }
.doc-table td:last-child, .doc-table th:last-child { text-align: right; }
.doc-table-total td { font-weight: 700; color: var(--text-strong); border-top: 2px solid var(--border-strong); border-bottom: none; }
.document-rule { font-size: 0.88rem; margin-bottom: 1.25rem; }
.document-signature-block { border-top: 1px solid var(--border-soft); padding-top: 1rem; }
.signature-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 0.5rem 0;
  font-size: 0.9rem;
  border-bottom: 1px solid var(--surface-alt);
}
.signature-row:last-child { border-bottom: none; }
.document-disclaimer { margin-top: 1.5rem; font-size: 0.75rem; color: var(--text-disclaimer); font-style: italic; }

/* -------------------------------------------------------------- Email preview */

.email-preview-frame { max-width: 640px; padding: 0; overflow: hidden; }
.email-preview-meta {
  padding: 1rem 1.5rem;
  background: var(--surface-raised);
  border-bottom: 1px solid var(--border-soft);
  font-size: 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}
.email-preview-meta-label { display: inline-block; width: 60px; color: var(--text-faint); font-weight: 600; }
.email-preview-body { padding: 2rem 1.5rem; line-height: 1.7; color: var(--text); }
.email-preview-brand {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--text-strong);
  margin-bottom: 1.5rem;
}
.email-preview-brand-icon { height: 22px; width: auto; }
.email-preview-greeting { font-weight: 600; margin-bottom: 0.75rem; }
.email-preview-body p { margin: 0 0 1rem; }
.email-preview-cta { display: inline-block; margin: 0.5rem 0 1.5rem; }
.email-preview-footer { font-size: 0.75rem; border-top: 1px solid var(--border-soft); padding-top: 1rem; margin-top: 1rem; }

/* -------------------------------------------------------------------- Flash */

.flash-message { margin-bottom: 1.25rem; }

/* ------------------------------------------------------------------ Sign CTA */

.sign-cta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1.25rem;
}
.sign-cta p { margin: 0; font-size: 0.88rem; }

.sign-panel { max-width: 720px; }
.sign-consent-label { display: flex; align-items: flex-start; gap: 0.5rem; font-size: 0.88rem; font-weight: 400; }
.sign-consent-label input[type="checkbox"] { margin-top: 0.2rem; }

/* --------------------------------------------------------------- Certificate */

.certificate-signers { display: flex; flex-direction: column; gap: 0.75rem; }
.certificate-signer-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--surface-alt);
  flex-wrap: wrap;
  gap: 0.4rem;
}
.certificate-signer-row:last-child { border-bottom: none; }
.certificate-signer-meta { font-size: 0.85rem; }

.audit-trail { display: flex; flex-direction: column; gap: 0.5rem; }
.audit-row { font-size: 0.85rem; color: var(--text); }

/* ---------------------------------------------------------- Transitional form */

.transitional-form { max-width: 820px; }

.field-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
}

.dynamic-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)) auto;
  gap: 0.5rem;
  align-items: center;
  margin-bottom: 0.6rem;
  padding-bottom: 0.6rem;
  border-bottom: 1px solid var(--surface-alt);
}
.dynamic-row:last-child { border-bottom: none; }

/* ------------------------------------------------------------ Broker rollups */

.funnel-row { display: flex; align-items: center; gap: 0.75rem; margin-bottom: 0.6rem; }
.funnel-row:last-child { margin-bottom: 0; }
.funnel-label { width: 110px; font-size: 0.82rem; color: var(--text-muted); flex-shrink: 0; }
.funnel-bar-track { flex: 1; background: var(--surface-alt); border-radius: 4px; height: 18px; overflow: hidden; }
.funnel-bar { background: var(--bulma-primary); height: 100%; border-radius: 4px; min-width: 2px; }
.funnel-count { width: 24px; text-align: right; font-weight: 700; font-size: 0.85rem; flex-shrink: 0; }

.activity-feed { display: flex; flex-direction: column; gap: 0.7rem; }
.activity-feed-row { font-size: 0.85rem; border-bottom: 1px solid var(--surface-alt); padding-bottom: 0.6rem; }
.activity-feed-row:last-child { border-bottom: none; padding-bottom: 0; }
.activity-feed-meta { font-size: 0.75rem; margin-top: 0.15rem; }

/* ------------------------------------------------------ Admin flow diagram */

.flow-diagram {
  display: flex;
  align-items: stretch;
  gap: 0.5rem;
  padding: 1.5rem 1.25rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow-x: auto;
}
.flow-step {
  flex: 1;
  min-width: 130px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.6rem;
  padding: 0.5rem;
}
.flow-step-icon {
  width: 3rem;
  height: 3rem;
  border-radius: 999px;
  background: var(--realez-primary-lite);
  color: var(--bulma-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.flow-step-icon svg { width: 1.5rem; height: 1.5rem; }
.flow-step-label { font-size: 0.82rem; font-weight: 600; color: var(--text); }
.flow-step-revenue .flow-step-icon { background: var(--realez-secondary-lite); color: var(--realez-secondary); }
.flow-step-revenue .flow-step-label { color: var(--revenue-text); }
.flow-arrow { display: flex; align-items: center; color: var(--text-faintest); font-size: 1.3rem; flex-shrink: 0; }
@media (max-width: 900px) {
  .flow-diagram { flex-direction: column; }
  .flow-arrow { transform: rotate(90deg); align-self: center; }
}

/* ------------------------------------------------------------ Theme toggle */

.theme-toggle-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  cursor: pointer;
  color: var(--text-secondary);
  flex-shrink: 0;
}
.theme-toggle-btn:hover { border-color: var(--bulma-primary); color: var(--bulma-primary); }
.theme-toggle-icon { display: flex; }
.theme-toggle-icon svg { width: 1.15rem; height: 1.15rem; }
.theme-toggle-icon-moon { display: none; }
:root[data-theme="dark"] .theme-toggle-icon-sun { display: none; }
:root[data-theme="dark"] .theme-toggle-icon-moon { display: flex; }

/* --------------------------------------------------------- Notification bell */

.top-bar-actions { position: fixed; top: 0.85rem; right: 1.25rem; z-index: 30; display: flex; align-items: center; gap: 0.5rem; }
.notif-bell { position: relative; }
.notif-bell-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  cursor: pointer;
  color: var(--text-secondary);
  list-style: none;
}
.notif-bell-toggle::-webkit-details-marker { display: none; }
.notif-bell-toggle:hover { border-color: var(--bulma-primary); color: var(--bulma-primary); }
.notif-bell-toggle svg { width: 1.15rem; height: 1.15rem; }
.notif-bell-badge {
  position: absolute;
  top: -0.3rem;
  right: -0.3rem;
  min-width: 1.15rem;
  height: 1.15rem;
  padding: 0 0.3rem;
  border-radius: 999px;
  background: var(--bulma-danger);
  color: #ffffff;
  font-size: 0.68rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}
.notif-bell-panel {
  position: absolute;
  top: calc(100% + 0.6rem);
  right: 0;
  width: min(340px, calc(100vw - 2.5rem));
  max-height: 420px;
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 12px 28px rgba(20, 30, 45, 0.12);
  padding: 1rem;
}
.notif-bell-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 0.6rem; }
.notif-bell-mark-read {
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--bulma-primary);
  cursor: pointer;
}
.notif-bell-row { padding: 0.55rem 0; border-bottom: 1px solid var(--surface-alt); font-size: 0.85rem; }
.notif-bell-row:last-child { border-bottom: none; }
.notif-bell-meta { display: block; font-size: 0.72rem; margin-top: 0.15rem; }
.notif-bell-empty { font-size: 0.85rem; padding: 0.5rem 0; }

/* ------------------------------------------------------ Printable documents */

/* The "Download" button on a document/certificate page just calls
   window.print() — this is what makes that produce a clean single-page
   artifact (letterhead + body + signatures) instead of the whole app chrome.
   .document-paper carries its own title/letterhead (see generic_render.html
   and certificate.html), so everything else in the shell can simply be
   hidden rather than picked apart piece by piece. */
@media print {
  .app-sidebar, .drawer-toggle, .top-bar-actions, .page-header,
  .sign-cta, .flash-message, .document-signature-block a, .no-print { display: none !important; }
  body, .app-shell, .app-main { background: #ffffff !important; }
  .app-main { padding: 0; }
  .document-paper { border: none; box-shadow: none; padding: 0; max-width: none; }
  .closing-packet-doc { page-break-before: always; }
}

/* -------------------------------------------------- Client mobile tab bar */

.client-tab-bar { display: none; }
@media (max-width: 768px) {
  .client-tab-bar {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 25;
    background: var(--surface);
    border-top: 1px solid var(--border);
    padding-bottom: env(safe-area-inset-bottom, 0);
  }
}
.client-tab {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
  padding: 0.55rem 0 0.45rem;
  color: var(--text-faint);
  font-size: 0.7rem;
  font-weight: 600;
  position: relative;
}
.client-tab svg { width: 1.3rem; height: 1.3rem; }
.client-tab.is-active { color: var(--bulma-primary); }
.client-tab-badge {
  position: absolute;
  top: 0.3rem;
  left: 50%;
  margin-left: 0.35rem;
  min-width: 1rem;
  height: 1rem;
  padding: 0 0.25rem;
  font-size: 0.62rem;
}

/* -------------------------------------------------------- Activity timeline */

.timeline { list-style: none; margin: 0; padding: 0; }
.timeline-row { display: flex; gap: 0.9rem; padding-bottom: 1.25rem; position: relative; }
.timeline-row:last-child { padding-bottom: 0; }
.timeline-row::before {
  content: "";
  position: absolute;
  left: 0.95rem;
  top: 2rem;
  bottom: 0;
  width: 2px;
  background: var(--border-soft);
}
.timeline-row:last-child::before { display: none; }
.timeline-icon {
  flex-shrink: 0;
  width: 1.9rem;
  height: 1.9rem;
  border-radius: 999px;
  background: var(--realez-primary-lite);
  color: var(--bulma-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1;
}
.timeline-icon svg { width: 1rem; height: 1rem; }
.timeline-body { padding-top: 0.15rem; }
.timeline-body p { margin: 0; font-size: 0.88rem; color: var(--text); }
.timeline-meta { font-size: 0.75rem !important; margin-top: 0.2rem !important; color: var(--text-faint) !important; }
.timeline-row-note .timeline-icon { background: var(--badge-warning-bg); color: var(--badge-warning-text); }
.timeline-note-form { display: flex; flex-direction: column; gap: 0.5rem; margin-bottom: 1.25rem; }
.timeline-note-form button { align-self: flex-end; }

/* -------------------------------------------------------------- Tour widget */

.tour-widget {
  background: var(--realez-primary-lite);
  border: 1px solid var(--tour-border);
  border-radius: 8px;
  padding: 1rem 1.25rem;
  margin-bottom: 1.25rem;
}
.tour-widget-header { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.tour-widget-title { font-weight: 700; color: var(--tour-title); font-size: 0.95rem; }
.tour-widget-skip {
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  font-size: 0.8rem;
  color: var(--badge-info-text);
  text-decoration: underline;
  cursor: pointer;
  flex-shrink: 0;
}
.tour-widget-body { color: var(--badge-info-text); font-size: 0.85rem; margin: 0.5rem 0 0.85rem; line-height: 1.55; }
.tour-widget-footer { margin: 0; }

/* --------------------------------------------------------------- Property map */

.property-map { height: 200px; border-radius: 8px; z-index: 0; }
.transactions-map { height: 560px; border-radius: 8px; z-index: 0; }

.filter-bar-toggle {
  display: flex;
  margin-left: auto;
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
}
.filter-bar-toggle-link { padding: 0.4rem 0.9rem; font-size: 0.85rem; font-weight: 600; color: var(--text-muted); }
.filter-bar-toggle-link:hover { background: var(--surface-alt); }
.filter-bar-toggle-link.is-active { background: var(--realez-primary-lite); color: var(--bulma-primary); }

/* ------------------------------------------------------------- Deadlines calendar */

.calendar-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin-bottom: 1rem;
}
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
}
.calendar-weekday {
  background: var(--surface-alt);
  padding: 0.5rem;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  text-align: center;
}
.calendar-cell {
  background: var(--surface);
  min-height: 6rem;
  padding: 0.4rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.calendar-cell.is-empty { background: var(--surface-alt); }
.calendar-cell.is-today { background: var(--realez-primary-lite); }
.calendar-day-number { font-size: 0.8rem; font-weight: 700; color: var(--text-strong); }
.calendar-event {
  display: block;
  font-size: 0.7rem;
  padding: 0.15rem 0.3rem;
  border-radius: 2px;
  border-left: 2px solid var(--bulma-primary);
  background: var(--surface-alt);
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.calendar-event.is-trid-wait { border-left-color: var(--badge-warning-text); }
@media (max-width: 700px) {
  .calendar-weekday { font-size: 0.6rem; padding: 0.3rem 0.1rem; }
  .calendar-cell { min-height: 3.5rem; padding: 0.2rem; }
  .calendar-event { font-size: 0.62rem; }
}

/* ---------------------------------------------------------------- Skip link */

/* Hidden until keyboard-focused (standard "skip to content" pattern) — lets
   a keyboard/screen-reader user bypass the sidebar nav on every single page
   load instead of tabbing through it every time. */
.skip-link {
  position: absolute;
  top: -3rem;
  left: 0.75rem;
  z-index: 100;
  background: var(--bulma-primary);
  color: #ffffff;
  padding: 0.6rem 1rem;
  border-radius: 6px;
  font-weight: 700;
  font-size: 0.88rem;
  text-decoration: none;
  transition: top 0.15s ease;
}
.skip-link:focus { top: 0.75rem; }

/* -------------------------------------------------------------- Pricing tiers */

.pricing-tiers { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1rem; }
.pricing-tier { position: relative; text-align: center; }
.pricing-tier.is-featured { border-color: var(--bulma-primary); }
.pricing-tier-tag { position: absolute; top: -0.6rem; left: 50%; transform: translateX(-50%); }
.pricing-tier-price { font-size: 1.5rem; font-weight: 800; color: var(--text-strong); margin: 0.3rem 0; }

/* ---------------------------------------------------------- Competitor analysis */

.feature-mark { font-size: 0.82rem; font-weight: 600; white-space: nowrap; }
.feature-mark.feature-yes { color: var(--badge-success-text); }
.feature-mark.feature-partial { color: var(--badge-warning-text); }
.feature-mark.feature-no { color: var(--text-disclaimer); }

.feature-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1.5rem;
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.competitor-accordion-list { display: flex; flex-direction: column; gap: 0.75rem; }
.competitor-accordion {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  overflow: hidden;
}
.competitor-accordion-summary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem;
  padding: 0.9rem 1.2rem;
  cursor: pointer;
  list-style: none;
}
.competitor-accordion-summary::-webkit-details-marker { display: none; }
.competitor-accordion-summary::after {
  content: "\25be";
  margin-left: auto;
  color: var(--text-faint);
  transition: transform 0.15s ease;
}
.competitor-accordion[open] .competitor-accordion-summary::after { transform: rotate(-180deg); }
.competitor-accordion-name { font-weight: 700; color: var(--text-strong); }
.competitor-accordion-meta { font-size: 0.78rem; color: var(--text-faint); }
.competitor-accordion-panel {
  padding: 0 1.2rem 1.2rem;
  border-top: 1px solid var(--border);
  padding-top: 1rem;
}
.competitor-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; }
.competitor-fact-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1rem; }
.competitor-fact-grid p:last-child { font-size: 0.85rem; color: var(--text-secondary); line-height: 1.5; }

@media (max-width: 700px) {
  .competitor-columns { grid-template-columns: 1fr; }
}

.journey-diagram { min-width: 640px; }
.journey-diagram svg { max-width: 100%; height: auto; }
.journey-legend { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1rem; }

.journey-anchor-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem 1.1rem;
  padding: 0.85rem 1.1rem;
  margin-bottom: 1.75rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-alt);
  font-size: 0.82rem;
  position: sticky;
  top: 0.5rem;
  z-index: 5;
}
.journey-anchor-nav strong { color: var(--text-strong); margin-right: 0.25rem; }
.journey-anchor-nav a { color: var(--text-secondary); text-decoration: underline; }
.journey-anchor-nav a:hover { color: var(--bulma-primary); }

.journey-phase {
  margin-bottom: 2rem;
  padding: 1.75rem 2rem;
  border: 1px solid var(--border);
  border-left: 4px solid var(--border-strong);
  border-radius: 8px;
  background: var(--surface);
  scroll-margin-top: 4.5rem;
}
.journey-phase-header { display: flex; align-items: center; gap: 0.85rem; margin-bottom: 0.6rem; }
.journey-phase-number {
  flex-shrink: 0;
  width: 2.1rem;
  height: 2.1rem;
  border-radius: 999px;
  background: var(--bulma-primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1rem;
}
.journey-phase-summary { color: var(--text-secondary); margin-bottom: 1.4rem; max-width: 72ch; line-height: 1.55; }
.journey-doc-table td { vertical-align: top; padding-top: 0.65rem; padding-bottom: 0.65rem; }
.journey-doc-table td:first-child { white-space: nowrap; font-weight: 600; color: var(--text-strong); }
.journey-doc-table td:last-child { color: var(--text-secondary); line-height: 1.5; }

.journey-callout {
  margin-top: 1.5rem;
  padding: 1.1rem 1.4rem;
  border: 1px solid var(--tour-border);
  border-radius: 8px;
  background: var(--realez-secondary-lite);
  color: var(--tour-title);
  line-height: 1.6;
}
.journey-callout code {
  background: rgba(0, 0, 0, 0.08);
  padding: 0.05rem 0.35rem;
  border-radius: 3px;
  font-size: 0.85em;
}
.journey-callout a { color: inherit; text-decoration: underline; }

.journey-figure { font-weight: 800; font-size: 1.1em; color: var(--bulma-primary); }
.journey-commission-table td:nth-child(2),
.journey-commission-table td:nth-child(3) { font-weight: 700; color: var(--revenue-text); }

@media (max-width: 700px) {
  .journey-anchor-nav { position: static; }
  .journey-phase { padding: 1.25rem 1.25rem; }
}
.competitor-card-link { font-size: 0.8rem; font-weight: 400; margin-left: 0.25rem; text-decoration: none; }
.competitor-card-label { font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.03em; color: var(--text-faint); margin-bottom: 0.3rem; }
.competitor-list { margin: 0; padding-left: 1.1rem; font-size: 0.85rem; color: var(--text); }
.competitor-list li { margin-bottom: 0.25rem; }
.competitor-case-study { font-size: 0.85rem; color: var(--text-secondary); line-height: 1.6; }
.competitor-case-study strong { color: var(--text-strong); }

/* ------------------------------------------------------------- Completion bar */

.completion-bar-row { display: flex; align-items: center; gap: 0.75rem; margin-bottom: 1rem; }
.completion-bar { flex: 1; height: 0.6rem; max-width: 220px; }
.completion-bar-label { font-size: 0.82rem; white-space: nowrap; }

/* ------------------------------------------------------- Cancel transaction */

.cancel-transaction-disclosure summary { cursor: pointer; list-style: none; }
.cancel-transaction-disclosure summary::-webkit-details-marker { display: none; }
.cancel-transaction-form {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.6rem;
  flex-wrap: wrap;
}

/* ------------------------------------------------------------ Attachments */

.attachment-row {
  display: flex;
  flex-direction: column;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border-soft);
}
.attachment-row:last-child { border-bottom: none; }
.attachment-meta { font-size: 0.75rem; margin-top: 0.15rem; }
.attachment-upload-form { display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap; }

/* -------------------------------------------------------------- Chatbot widget */

.chatbot-toggle {
  position: fixed;
  right: 1.25rem;
  bottom: 1.25rem;
  z-index: 30;
  width: 3.25rem;
  height: 3.25rem;
  border-radius: 999px;
  border: none;
  background: var(--bulma-primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.chatbot-toggle svg { width: 1.4rem; height: 1.4rem; }
.chatbot-panel {
  position: fixed;
  right: 1.25rem;
  bottom: 5rem;
  z-index: 30;
  width: 320px;
  max-height: 540px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.chatbot-panel[hidden] { display: none; }
.chatbot-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.65rem 1rem;
  border-bottom: 1px solid var(--border);
  font-weight: 700;
  color: var(--text-strong);
}
.chatbot-close { background: none; border: none; cursor: pointer; font-size: 1.2rem; color: var(--text-muted); line-height: 1; }
.chatbot-messages {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 0.75rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.chatbot-message {
  max-width: 85%;
  padding: 0.45rem 0.7rem;
  border-radius: 8px;
  font-size: 0.82rem;
  line-height: 1.4;
}
.chatbot-message.is-user { align-self: flex-end; background: var(--bulma-primary); color: #fff; }
.chatbot-message.is-bot { align-self: flex-start; background: var(--surface-alt); color: var(--text); }
.chatbot-samples {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  padding: 0.65rem 1rem;
  border-top: 1px solid var(--border);
  max-height: 140px;
  overflow-y: auto;
  flex-shrink: 0;
}
.chatbot-sample-question {
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.3rem 0.65rem;
  font-size: 0.72rem;
  color: var(--text-secondary);
  cursor: pointer;
  text-align: left;
  line-height: 1.3;
}
.chatbot-sample-question:hover { border-color: var(--bulma-primary); color: var(--bulma-primary); }
.chatbot-form { display: flex; gap: 0.5rem; padding: 0.65rem; border-top: 1px solid var(--border); }
.chatbot-form input { flex: 1; min-width: 0; border: 1px solid var(--border-strong); border-radius: 4px; padding: 0.4rem 0.6rem; background: var(--surface); color: var(--text); font-size: 0.85rem; }
.chatbot-thinking {
  margin: 0;
  padding: 0 0.75rem 0.5rem;
  font-size: 0.72rem;
  color: var(--text-faint);
  font-style: italic;
  display: none;
}
.chatbot-thinking.htmx-request { display: block; }
@media (max-width: 768px) {
  .chatbot-toggle { bottom: 5.75rem; }
  .chatbot-panel { bottom: 9.5rem; right: 1rem; left: 1rem; width: auto; max-height: 65vh; }
}
