/* RC22: Pair foregrounds with the actual surface of each commercial component. */
.cf-site {
  --rc22-ivory: #f5f1e8;
  --rc22-navy: #0b1016;
  --rc22-slate: #14212d;
  --rc22-form-navy: #111b25;
  --rc22-light-muted: #d2d7da;
  --rc22-light-accent: #e6ca96;
  --rc22-dark-muted: #43594f;
  --rc22-dark-accent: #71562a;
  --rc22-control-border: #82909a;
  --rc22-error: #ffb4a8;
}

/* Business and private enquiry components occupy dark surfaces. */
.cf-site .v6-contact-grid .v9-diagnostic-form {
  background: var(--rc22-form-navy);
  color: var(--rc22-ivory);
}

.cf-site .cf-contact-layout .nf-private-form {
  background: var(--rc22-navy);
  color: var(--rc22-ivory);
}

.cf-site :is(.v9-diagnostic-form, .nf-private-form) .nf-conversion h2 {
  /* Match the importance of the inherited light-panel conversion rules. */
  color: var(--rc22-ivory) !important;
}

.cf-site :is(.v9-diagnostic-form, .nf-private-form) .nf-conversion .nf-conversion-body {
  color: var(--rc22-light-muted) !important;
}

.cf-site :is(.v9-diagnostic-form, .nf-private-form) .nf-conversion .nf-conversion-kicker,
.cf-site :is(.v9-diagnostic-form, .nf-private-form) label > span,
.cf-site .v9-diagnostic-form label > span b,
.cf-site .nf-private-form [aria-hidden="true"] {
  color: var(--rc22-light-accent);
}

.cf-site :is(.v9-diagnostic-form, .nf-private-form) :is(.nf-form-helper, .v9-required-note, .v9-form-privacy) {
  color: var(--rc22-light-muted);
}

.cf-site :is(.v9-diagnostic-form, .nf-private-form) .v9-form-privacy a {
  color: var(--rc22-light-accent);
  text-decoration: underline;
  text-underline-offset: .15em;
}

.cf-site :is(.v9-diagnostic-form, .nf-private-form) .v9-form-privacy a:hover {
  color: var(--rc22-ivory);
}

.cf-site .v9-diagnostic-form :is(input:not([type="hidden"]), textarea),
.cf-site .nf-private-form :is(input:not([type="hidden"]), textarea) {
  color: var(--rc22-ivory);
  background: var(--rc22-navy);
  border-color: var(--rc22-control-border);
}

.cf-site :is(.v9-diagnostic-form, .nf-private-form) :is(input, textarea)::placeholder {
  color: var(--rc22-light-muted);
  opacity: 1;
}

.cf-site :is(.v9-diagnostic-form, .nf-private-form) :is(input:not([type="hidden"]), textarea):hover {
  border-color: var(--rc22-light-accent);
}

.cf-site :is(.v9-diagnostic-form, .nf-private-form) :is(input:not([type="hidden"]), textarea)[aria-invalid="true"] {
  border-color: var(--rc22-error);
}

.cf-site :is(.v9-diagnostic-form, .nf-private-form) :is(.nf-field-error, .v9-field-error) {
  color: var(--rc22-error);
}

.cf-site :is(.v9-diagnostic-form, .nf-private-form) :is(a, button, input, textarea, summary):focus-visible {
  outline: 2px solid var(--rc22-light-accent) !important;
  outline-offset: 3px !important;
}

.cf-site :is(.v9-diagnostic-form, .nf-private-form) #nox-form-status:not(:empty) {
  background: #e8e1d3;
  border: 1px solid #8d7048;
  color: var(--rc22-navy);
  padding: 1rem;
}

.cf-site :is(.v9-diagnostic-form, .nf-private-form) #nox-form-status.is-error {
  background: #f1dfd9;
  color: #70281f;
}

.cf-site :is(.v9-diagnostic-form, .nf-private-form) #nox-form-status:focus {
  outline: 2px solid var(--rc22-light-accent) !important;
  outline-offset: 3px !important;
}

/* The two market-entry value sections sit on the legacy ivory shell. */
.cf-site main[data-sales-argument="RC09"] > .nf-value {
  background: var(--rc22-ivory);
  color: var(--rc22-navy);
}

.cf-site main[data-sales-argument="RC09"] > .nf-value :is(.nf-value-intro, .nf-value-benefits p, .nf-value-footer > p:first-child, .nf-value-references) {
  color: var(--rc22-dark-muted);
}

.cf-site main[data-sales-argument="RC09"] > .nf-value :is(.cf-kicker, .nf-value-number, .nf-value-cta),
.cf-site.nf-demand:not(.cf-inner) #buyer-stakes .cf-kicker,
.cf-site .v12-fact-section .v12-principles > article > span {
  color: var(--rc22-dark-accent);
}

.cf-site main[data-sales-argument="RC09"] > .nf-value .nf-value-cta:hover {
  color: var(--rc22-navy);
  text-decoration: underline;
  text-underline-offset: .2em;
}

.cf-site main[data-sales-argument="RC09"] > .nf-value a:focus-visible,
.cf-site .cf-buyer-tool .cf-button:focus-visible {
  outline: 2px solid var(--rc22-dark-accent) !important;
  outline-offset: 4px !important;
}

/* The direct-answer and related links panels paint their own dark surface. */
.cf-site.nf-demand :is(.demand-answer, .demand-related) {
  background: var(--rc22-slate);
  color: var(--rc22-ivory);
}

.cf-site.nf-demand .demand-answer h2 {
  color: var(--rc22-ivory);
}

.cf-site.nf-demand .demand-related a {
  color: var(--rc22-light-accent);
  border-bottom-color: currentColor;
}

.cf-site.nf-demand .demand-related a:hover {
  color: var(--rc22-ivory);
}

.cf-site.nf-demand :is(.demand-answer, .demand-related) a:focus-visible,
.cf-site .note-byline a:focus-visible {
  outline-color: var(--rc22-light-accent) !important;
}

/* The worksheet button sits on ivory. Its text must stay light in each state. */
.cf-site .cf-buyer-tool .cf-button {
  color: var(--rc22-ivory) !important;
}

.cf-site .cf-buyer-tool .cf-button:hover {
  background: #254b3d;
  border-color: #254b3d;
}

/* CILF uses a dark article, unlike the legacy light article template. */
.cf-site .note-byline {
  color: var(--rc22-light-muted);
}

.cf-site .note-byline strong {
  color: var(--rc22-ivory);
}

.cf-site .note-byline a {
  color: var(--rc22-light-accent);
  text-decoration: underline;
  text-underline-offset: .15em;
}

.cf-site .note-byline a:hover {
  color: var(--rc22-ivory);
}

/* Keep editorial heading tracks usable with localized words. */
.cf-site :is(.note-section, .v6-article-body > section:has(> .v15-article-heading)) {
  grid-template-columns: minmax(12rem, 1fr) minmax(0, 2.8fr);
  gap: clamp(1.25rem, 4vw, 3.75rem);
}

.cf-site main :is(.note-section > h2, .v6-article-body .v15-article-heading) {
  font-size: clamp(1.2rem, 2vw, 1.65rem);
  letter-spacing: .04em;
  line-height: 1.3;
  overflow-wrap: normal;
  word-break: normal;
  hyphens: auto;
}

@media (max-width: 900px) {
  .cf-site :is(.note-section, .v6-article-body > section:has(> .v15-article-heading)) {
    grid-template-columns: minmax(0, 1fr);
    gap: 1rem;
  }

  .cf-site .v6-article-body > section:has(> .v15-article-heading) > * {
    grid-column: 1;
  }
}

html[lang="en"] .cf-site .v6-contact-grid .v12-diagnostic-proof p,
html[lang="en"] .cf-site .v9-diagnostic-form :is(.nf-conversion-body, .nf-form-helper) {
  hyphens: none;
  overflow-wrap: break-word;
}

@media (max-width: 1000px) {
  .cf-site:is(:lang(de), :lang(lb)) .cf-page-hero:has(+ .v6-article-body .v15-article-heading) .cf-page-copy h1 {
    font-size: clamp(1.5rem, 4.3vw, 2.5rem);
    overflow-wrap: break-word;
    hyphens: manual;
  }
}
