/*
 * Public marketing color refinement only.
 * Scope is the presence of the shared public header, not a body-class script.
 * No root tokens, layout geometry, typography, media, or status colors change.
 * Text teal is darker than decorative teal; white CTA text meets WCAG AA.
 */
body:has(> .ew-public-header) {
  --ew-color-navy: #0b2430;
  --ew-color-teal: #0e8a8f;
  --ew-color-action: #087f85;
  --ew-color-action-hover: #066c72;
  --ew-color-teal-text: #087078;
  --ew-color-neutral: #f6f8fa;
  --ew-color-secondary: #fafbfc;
  --ew-color-conversion: #081f2a;
  --ew-color-border: #e1e7ea;
  --ew-color-border-strong: #c8d3d9;
  --ew-color-white: #ffffff;
  --ew-color-muted: #53616b;
  --ew-color-focus: #0e8a8f;
  --shadow-sm: 0 1px 3px rgba(11,36,48,.035);
  --shadow: 0 3px 12px rgba(11,36,48,.055);
  --shadow-card: 0 1px 3px rgba(11,36,48,.035);
  --shadow-lift: 0 3px 12px rgba(11,36,48,.055);

  /* Current marketing templates: home, Collect/Send, QBO, How It Works. */
  --ink: var(--ew-color-navy);
  --muted: var(--ew-color-muted);
  --teal: var(--ew-color-teal-text);
  --teal-deep: var(--ew-color-teal-text);
  --teal-pale: var(--ew-color-secondary);
  --paper: var(--ew-color-white);
  --surface: var(--ew-color-white);
  --wash: var(--ew-color-neutral);
  --line: var(--ew-color-border);
  --line-strong: var(--ew-color-border-strong);

  /* Earlier marketing templates and shared-shell supporting pages. */
  --text-primary: var(--ew-color-navy);
  --text-secondary: var(--ew-color-muted);
  --text-tertiary: var(--ew-color-muted);
  --primary: var(--ew-color-teal-text);
  --primary-hover: var(--ew-color-action-hover);
  --primary-deep: var(--ew-color-navy);
  --primary-mid: var(--ew-color-action);
  --primary-light: var(--ew-color-secondary);
  --bg-page: var(--ew-color-neutral);
  --bg-card: var(--ew-color-white);
  --border: var(--ew-color-border);
  --border-subtle: var(--ew-color-neutral);
}

/* Remove the broad mint wash, without changing any hero positioning. */
body:has(> .ew-public-header) .hero:has(.heroGrid),
body:has(> .ew-public-header) .hero:has(.hero-eyebrow),
body:has(> .ew-public-header) .hero:has(.hero-demo-link),
body:has(> .ew-public-header) .hero:has(.hero-badge .dot) {
  background: var(--ew-color-white);
}
body:has(> .ew-public-header) .blog-hero {
  background: var(--ew-color-neutral);
}
body:has(> .ew-public-header) :is(#product, #pricing, .section-alt) {
  background-color: var(--ew-color-neutral);
}
/* Homepage: white hero / neutral workflows / white video / neutral proof /
 * white approved forms / neutral pricing / existing navy final CTA.
 */
body:has(> .ew-public-header) :is(#watch, .multi) {
  background: var(--ew-color-white);
}
body:has(> .ew-public-header) #proof {
  background: var(--ew-color-neutral);
}
/* Respect each supporting page's section boundaries rather than alternating
 * by child index. Unaccented sections retain their existing white surface.
 * GC: neutral workflow/forms; Subcontractors: neutral workflow/control;
 * QBO: neutral workflow/send; Bookkeepers: neutral setup/workspaces;
 * How It Works: neutral choice/forms; Category guide: neutral workflow.
 */
body:has(> .ew-public-header) :is(section#workflow, section#control,
  section#send, section#client-workspaces) {
  background: var(--ew-color-neutral);
}
body:has(> .ew-public-header) section#forms.soft {
  background: var(--ew-color-neutral);
}
/* These walkthrough sections separate neutral setup/choice from neutral form
 * and workspace control, so they remain white rather than merging accents.
 */
body:has(> .ew-public-header):has(section#client-setup) section#workflow,
body:has(> .ew-public-header):has(section#choose-workflow) section#workflow {
  background: var(--ew-color-white);
}
/* Tracking: white hero / neutral workflow / neutral proof / white proof /
 * neutral personas / white templates / neutral pricing / white FAQ / navy CTA.
 */
body:has(> .ew-public-header) section.wf-section#workflow {
  background: var(--ew-color-neutral);
}
body:has(> .ew-public-header) :is(.proof-section.proof-alt, .personas-section) {
  background: var(--ew-color-neutral);
}
body:has(> .ew-public-header) :is(.setupCard, .formsPanel, .ownershipCard, .pricingAnchor) {
  background: var(--ew-color-white);
  border-color: var(--ew-color-border);
}
body:has(> .ew-public-header) .ownershipCard:first-child {
  background: var(--ew-color-white);
}
body:has(> .ew-public-header) :is(.caption, .proofStage) {
  background: var(--ew-color-secondary);
}

/* Primary actions have an AA-safe fill; text links keep the darker text teal. */
body:has(> .ew-public-header) :is(.btn.primary, .btn-primary, .btn-submit, .contact-box a) {
  background: var(--ew-color-action);
  color: var(--ew-color-white);
}
body:has(> .ew-public-header) :is(.btn.primary, .btn-primary, .btn-submit, .contact-box a):hover {
  background: var(--ew-color-action-hover);
}
body:has(> .ew-public-header) :is(.btn.quiet, .btn-secondary, .btn-outline) {
  background: var(--ew-color-white);
  color: var(--ew-color-teal-text);
  border-color: var(--ew-color-border-strong);
}
body:has(> .ew-public-header) :is(.btn.quiet, .btn-secondary, .btn-outline):hover {
  background: var(--ew-color-neutral);
  color: var(--ew-color-teal-text);
  border-color: var(--ew-color-teal-text);
}

/* Existing conversion sections only; no additional dark sections introduced. */
body:has(> .ew-public-header) :is(.final, .final-cta, .cta-final, .cta-strip) {
  background: var(--ew-color-conversion);
}
body:has(> .ew-public-header) .pricing-card.featured {
  background: var(--ew-color-white);
  border-color: var(--ew-color-border-strong);
}
body:has(> .ew-public-header) :is(.final, .final-cta, .cta-final, .cta-strip)
  :is(.btn.quiet, .btn-secondary, .btn-outline, .btn-white-outline, .btn-cta-secondary) {
  background: transparent;
  color: var(--ew-color-white);
  border-color: #9cbfc5;
}
body:has(> .ew-public-header) :is(.final, .final-cta, .cta-final, .cta-strip)
  :is(.btn.quiet, .btn-secondary, .btn-outline, .btn-white-outline, .btn-cta-secondary):hover {
  background: #183b48;
  color: var(--ew-color-white);
  border-color: var(--ew-color-white);
}
/* One primary action color, including the earlier inverse-CTA templates. */
body:has(> .ew-public-header) .final-cta .btn-primary,
body:has(> .ew-public-header) :is(.btn-white, .btn-cta-primary, .pricing-btn-featured) {
  background: var(--ew-color-action);
  color: var(--ew-color-white);
}
body:has(> .ew-public-header) .final-cta .btn-primary:hover,
body:has(> .ew-public-header) :is(.btn-white, .btn-cta-primary, .pricing-btn-featured):hover {
  background: var(--ew-color-action-hover);
}

/* Hardcoded supporting-page colors: the partner page has no legacy tokens. */
body:has(> .ew-public-header) .hero:has(.btn-hero) {
  background: var(--ew-color-navy);
}
body:has(> .ew-public-header) .btn-hero {
  color: var(--ew-color-teal-text);
}
body:has(> .ew-public-header) :is(.stat-val, .step-num) {
  color: var(--ew-color-teal-text);
}
body:has(> .ew-public-header) .step-num {
  background: var(--ew-color-secondary);
}
body:has(> .ew-public-header) :is(.stat-label, .section-subtitle, .commission-card p,
  .form-card .form-subtitle, .form-group .hint, .faq-a, .step p) {
  color: var(--ew-color-muted);
}
body:has(> .ew-public-header) :is(.commission-card, .form-card, .faq-item) {
  border-color: var(--ew-color-border);
}
body:has(> .ew-public-header) .contact-box {
  background: var(--ew-color-secondary);
}

/* Restrained marketing surfaces; never target authentic status indicators or
 * image/video pixels. Existing padding, widths, border widths and spacing stay.
 */
body:has(> .ew-public-header) :is(.heroPreview, .proofCard, .setupCard,
  .formsPanel, .ownershipCard, .transactionCard, .workflowCard, .pricingAnchor,
  .audienceCard, .plan, .guide-card, .workflow-card, .form-card, .pricing-summary,
  .scope-card, .ba-card, .tpl-card, .persona-card, .feature-card, .pricing-card) {
  background: var(--ew-color-white);
  border-color: var(--ew-color-border);
  border-radius: 16px;
  box-shadow: var(--shadow-sm);
}
body:has(> .ew-public-header) :is(.shot, .outcomeMedia img, .mockup-frame, .proof-frame) {
  border-color: var(--ew-color-border);
  box-shadow: var(--shadow);
}
body:has(> .ew-public-header) .homepageVideoPreview {
  border-color: var(--ew-color-border);
  border-radius: 16px;
  box-shadow: none;
}
body:has(> .ew-public-header) :is(.mockup-frame, .proof-frame) {
  background: var(--ew-color-white);
}
body:has(> .ew-public-header) .hero-visual::before {
  background: none;
}
body:has(> .ew-public-header) :is(.eyebrow, .hero-eyebrow, .hero-badge, .popular,
  .wf-num, .pb-icon, .pib-teal, .fi-teal, .relationship .owned, .buyer-note) {
  background: var(--ew-color-secondary);
  border-color: var(--ew-color-border);
}
body:has(> .ew-public-header) :is(.eyebrow, .hero-eyebrow, .hero-badge, .popular) {
  color: var(--ew-color-teal-text);
}
body:has(> .ew-public-header) :is(.eyebrow, .hero-eyebrow)::before {
  background: var(--ew-color-teal);
}
body:has(> .ew-public-header) :is(.boundary, .buyer-note, .chapter, .step) {
  border-color: var(--ew-color-border);
}
body:has(> .ew-public-header) :is(h2, h3, .scope-col-title, .ba-card-title,
  .tpl-card-title, .planAllowance, .transaction-label, .plan-row b) {
  color: var(--ew-color-navy);
}
/* Footer headings are inverse text, not ordinary light-surface headings. */
body:has(> .ew-public-header) .ew-public-footer .ew-footer-title {
  color: #e3efef;
}
/* Ordinary category/tracking headline spans are not strategic hero emphasis.
 * Homepage h1 em remains its established, selective teal accent.
 */
body:has(> .ew-public-header) :is(.hero-inner h1 span, .hero-headline span) {
  color: var(--ew-color-navy);
}
body:has(> .ew-public-header) :is(.section-sub, .hero-subhead, .hero-trial-note,
  .wf-desc, .proof-body, .proof-bullets li, .scope-list li, .ba-list li,
  .persona-desc, .feature-desc, .pricing-desc, .pricing-features li,
  .workflowPath, .compare-row > p:last-child) {
  color: var(--ew-color-muted);
}
/* Neutralize inverse text on the now-white featured pricing card. */
body:has(> .ew-public-header) .pricing-card.featured
  :is(.pricing-plan-name, .pricing-price-sub, .pricing-desc, .pricing-features li) {
  color: var(--ew-color-muted);
}
body:has(> .ew-public-header) .pricing-card.featured .pricing-price {
  color: var(--ew-color-navy);
}
body:has(> .ew-public-header) .pricing-card.featured .pricing-check {
  color: var(--green);
}
body:has(> .ew-public-header) .pricing-card.featured .pricing-plan-name span {
  background: var(--ew-color-secondary) !important; /* Existing inline badge. */
  color: var(--ew-color-teal-text);
}
body:has(> .ew-public-header) #pricing .plan.recommended {
  border-color: var(--ew-color-border-strong);
  box-shadow: inset 0 0 0 1px var(--ew-color-border), var(--shadow-sm);
}
body:has(> .ew-public-header) :is(.persona-card, .feature-card):hover {
  border-color: var(--ew-color-border-strong);
  box-shadow: var(--shadow-sm);
}
body:has(> .ew-public-header) :is(.btn.primary, .btn-primary, .btn-cta-primary,
  .pricing-btn-featured, .btn-submit, .contact-box a),
body:has(> .ew-public-header) :is(.btn.primary, .btn-primary, .btn-cta-primary,
  .pricing-btn-featured, .btn-submit, .contact-box a):hover {
  box-shadow: none;
}
body:has(> .ew-public-header) .pricing-btn-default {
  background: var(--ew-color-white);
  color: var(--ew-color-teal-text);
  border-color: var(--ew-color-border-strong);
}
body:has(> .ew-public-header) .pricing-btn-default:hover {
  background: var(--ew-color-neutral);
  border-color: var(--ew-color-teal-text);
}
body:has(> .ew-public-header) :is(.final, .final-cta, .cta-final, .cta-strip)
  :is(h2, h3) {
  color: var(--ew-color-white);
}
body:has(> .ew-public-header) :is(.final, .final-cta, .cta-final, .cta-strip)
  :is(.intro, .reassure, .small, .trustRow, .final-cta-trust-item) {
  color: #d5e0e5;
}

/* Brand teal focus contrasts >= 3:1 with white, cool-neutral and navy.
 * Keyboard modality alone shows the outline; no persistent pointer-focus ring.
 * Outlines do not participate in layout; existing control geometry is intact.
 */
body:has(> .ew-public-header) :is(a, button, input, textarea, select, summary):focus-visible {
  outline: 2px solid var(--ew-color-focus);
  outline-offset: 2px;
}
body:has(> .ew-public-header) :is(a, button, input, textarea, select, summary):focus:not(:focus-visible) {
  outline: none;
}
/* Logo remains unboxed in normal, hover and current-page states. This does
 * not override its keyboard outline, including when it is the current page.
 */
:is(.ew-public-header, .ew-public-footer) .ew-shell-logo {
  border: none;
  box-shadow: none;
}
:is(.ew-public-header, .ew-public-footer) .ew-shell-logo:not(:focus-visible) {
  outline: none;
}

/* Desktop and mobile current destinations. Text decoration never changes box
 * dimensions, and remains visible on hover rather than becoming a filled pill.
 */
.ew-public-header .ew-shell-links a:is([aria-current="page"], [aria-current="location"]),
.ew-public-header #mobileNavMenu a:is([aria-current="page"], [aria-current="location"]) {
  color: #087078;
  background: transparent;
  text-decoration-line: underline;
  text-decoration-color: #087078;
  text-decoration-thickness: 2px;
  text-underline-offset: 6px;
}
.ew-public-header .ew-shell-links a:is([aria-current="page"], [aria-current="location"]):hover,
.ew-public-header #mobileNavMenu a:is([aria-current="page"], [aria-current="location"]):hover {
  color: #0b2430;
  background: transparent;
  text-decoration-color: #0b2430;
}
.ew-public-header .ew-shell-links a:is([aria-current="page"], [aria-current="location"]):focus-visible,
.ew-public-header #mobileNavMenu a:is([aria-current="page"], [aria-current="location"]):focus-visible {
  outline: 2px solid #0e8a8f;
  outline-offset: 2px;
}
