/* Shared public brand colours; CRM pages retain their own palette. */
:is(.site-typography, .public-form, .ref-page, .public-properties, .public-listing-detail,
    body:has(.ref-page), body:has(.public-properties), body:has(.public-listing-detail)) {
  --ink: #24251f;
  --accent: #46543b;
  --accent-dark: #35422f;
  --dark: #35422f;
  --olive: #46543b;
  --olive-dark: #35422f;
  --cream: #e2e6dc;
  --cream-deep: #d5ddce;
  --deep: #d5ddce;
  --olive-pale: #e2e6dc;
  --cream-light: #f4f2eb;
  --light: #f4f2eb;
  --ivory: #f4f2eb;
  --paper: #faf8f2;
  --muted: #64645c;
  --line: rgba(70, 84, 59, .20);
  background-color: var(--light);
  color: var(--ink);
}
.site-typography .site-header { background: rgba(244, 242, 235, .96) !important; }
.site-typography .site-header .nav-cta,
.site-typography .site-header .nav .links.open .nav-cta {
  background: var(--accent) !important;
  border-color: var(--accent) !important;
  color: #faf8f2 !important;
}
.site-typography .site-header .nav-cta:hover,
.site-typography .site-header .nav .links.open .nav-cta:hover {
  background: var(--accent-dark) !important;
  border-color: var(--accent-dark) !important;
}
.public-form button.primary { background: var(--accent); border-color: var(--accent); color: var(--paper); }
.public-form .doc input { accent-color: var(--accent); }
@media print { .public-form { background: white; } }

/* Public text follows the contrast of its surface. The wordmark keeps its own colours. */
:is(.site-typography, .ref-page, .public-properties, .public-listing-detail) {
  --public-text-colour: #000;
}

:is(.site-typography, .ref-page, .public-properties, .public-listing-detail)
  :is(footer, .ref-card > aside, .primary-button, .report-link,
      .person-actions a:first-child, .mobile-contact, .mobile-contact-cta,
      .public-search-invitation a, .public-properties-empty a,
      .public-listing-content aside a:not(.secondary),
      .btn:not(.light, .ghost, .back), .button.primary, .plan.featured .button,
      .form-confirmation-check, .step.active i,
      .site-header .links.open .nav-cta, .site-typography .site-header .nav-cta,
      .public-form button.primary, #ownerFormMain .actions button:not(.secondary),
      #ownerFormMain .actions button.secondary:hover) {
  --public-text-colour: #fff;
}

/* A named layer lets the contrast rule override older page-specific colour rules. */
@layer public-text-contrast {
  :is(.site-typography, .ref-page, .public-properties, .public-listing-detail)
    :not(:where(.brand, .wordmark, .logo, .brand *, .wordmark *, .logo *,
                :has(.brand, .wordmark, .logo), svg, svg *)) {
    color: var(--public-text-colour, #000) !important;
  }

  :is(.site-typography, .ref-page, .public-properties, .public-listing-detail)
    :is(input, textarea)::placeholder {
    color: var(--public-text-colour, #000) !important;
  }
}
