/* Evergreen HSA — original visual system.
   Cool zinc + deep plum + teal. Not cream/olive/copper, not navy/gold, not navy/sky. */
:root {
  --paper: #f4f4f6;
  --paper-deep: #e8e8ed;
  --card: #ffffff;
  --ink: #1c1524;
  --ink-soft: #4a4554;
  --brand: #3a2154;
  --brand-mid: #4b2c6a;
  --accent: #0b6e6a;
  --accent-hover: #085854;
  --accent-soft: #d4edeb;
  --plum-soft: #d7c8e6;
  --line: #dddce3;
  --focus: #0b6e6a;
  --ok: #0b6e6a;
  --err: #9b1b3a;
  --err-bg: #fdedf1;
  --radius: 8px;
  --shadow: 0 8px 28px rgba(28, 21, 36, 0.08);
  --max: 1120px;
  --gutter: 1.15rem;
  --display: "Avenir Next", "Century Gothic", "Gill Sans", Calibri, sans-serif;
  --sans: "Helvetica Neue", Helvetica, Arial, sans-serif;
  /* Aliases so older class hooks keep working after the retint */
  --forest: var(--brand);
  --forest-mid: var(--brand-mid);
  --pine: var(--accent);
  --copper: var(--accent);
  --copper-soft: var(--plum-soft);
  --serif: var(--display);
}
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--sans);
  color: var(--ink);
  background: var(--paper);
  line-height: 1.65;
  font-size: 1.05rem;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; }
a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--brand); }
:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}
.skip { position: absolute; left: -999px; top: 0; }
.skip:focus { left: 12px; top: 12px; background: var(--card); padding: 8px 12px; z-index: 80; }

/* Header: nav lives inside the same max-width bar as the wordmark */
.site-header {
  background: var(--brand);
  color: #f8f5fc;
  position: sticky; top: 0; z-index: 40;
  border-bottom: 3px solid var(--accent);
}
.header-inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0.7rem var(--gutter);
  display: flex;
  align-items: center;
  justify-content: flex-start;
  flex-wrap: wrap;
  gap: 0.75rem 1rem;
}
.wordmark {
  font-family: var(--display);
  font-size: 1.25rem;
  font-weight: 700;
  color: #f8f5fc;
  text-decoration: none;
  letter-spacing: 0.01em;
}
.wordmark span { color: var(--plum-soft); font-weight: 600; }
.header-meta {
  display: block;
  font-size: 0.78rem;
  color: #e8dff3;
  line-height: 1.3;
  flex: 1 1 11rem;
}
.site-phone {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 0.14em;
  white-space: nowrap;
}
.site-phone:hover { color: var(--plum-soft); }
.nav-toggle {
  background: transparent; border: 1px solid #cbb8e0; color: #fff;
  border-radius: 8px; padding: 0.4rem 0.7rem; font: inherit; cursor: pointer;
  margin-left: auto;
}
.site-nav {
  display: none;
  flex-basis: 100%;
  background: var(--brand-mid);
  margin: 0 calc(var(--gutter) * -1);
  padding: 0 var(--gutter);
}
.site-nav.open { display: block; }
.site-nav ul {
  list-style: none; margin: 0; padding: 0.5rem 0 1rem;
}
.site-nav a {
  color: #f8f5fc; text-decoration: none;
  display: block; padding: 0.55rem 0;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}
.site-nav a:hover { color: var(--plum-soft); }
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 0.4rem;
  background: var(--accent);
  color: #ffffff !important;
  text-decoration: none !important;
  border: 0;
  border-radius: 8px;
  padding: 0.8rem 1.25rem;
  font: 650 1rem var(--sans);
  cursor: pointer;
}
.btn:hover { background: var(--accent-hover); }
.btn-copper, .btn-accent { background: var(--accent); }
.btn-copper:hover, .btn-accent:hover { background: var(--accent-hover); }
.btn-ghost {
  background: transparent;
  color: var(--brand) !important;
  border: 1.5px solid var(--brand);
}
.btn-ghost:hover { background: var(--paper-deep); }
.btn-wide { width: 100%; }
.site-nav .btn {
  margin-top: 0.5rem;
  background: var(--accent);
  color: #fff !important;
  border: 0;
  display: inline-flex;
}

/* Shared page width — padding is inside the max-width so header, main, and footer line up */
.hero-grid, .wrap, .page-wrap, .footer-inner, .header-inner {
  max-width: var(--max);
  margin-left: auto;
  margin-right: auto;
}
.hero-grid, .wrap, .page-wrap {
  padding: 1.5rem var(--gutter) 2rem;
  width: 100%;
}

/* Hero */
.hero {
  background: linear-gradient(180deg, #ece7f3 0%, var(--paper) 72%);
  border-bottom: 1px solid var(--line);
}
.hero-grid { display: grid; gap: 1.5rem; }
.kicker {
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 700;
  margin: 0 0 0.5rem;
}
h1, h2, h3, h4 {
  font-family: var(--display);
  color: var(--brand);
  line-height: 1.2;
  letter-spacing: 0;
  margin: 0 0 0.7rem;
}
h1 { font-size: 2rem; }
h2 { font-size: 1.55rem; margin-top: 2rem; }
h3 { font-size: 1.2rem; margin-top: 1.4rem; }
p { margin: 0 0 1rem; }
/* Prose measure only — do not shrink cards, grids, or tables */
.wrap > p,
.page-wrap > p,
.lede,
.page-body > p { max-width: 70ch; }
.lede { font-size: 1.12rem; color: var(--ink-soft); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 0.7rem; margin: 1.1rem 0 0.4rem; }
.micro { font-size: 0.88rem; color: var(--ink-soft); margin: 0; }
.reviewed { font-size: 0.86rem; color: var(--ink-soft); }

/* Trust */
.trust-row {
  display: grid;
  gap: 0.7rem;
  margin-top: 1.2rem;
  width: 100%;
}
.trust-item {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.8rem 0.9rem;
  font-size: 0.9rem;
}
.trust-item strong { display: block; color: var(--brand); font-size: 0.78rem; letter-spacing: 0.04em; text-transform: uppercase; }

/* Cards / steps */
.steps { display: grid; gap: 0.9rem; margin: 1.2rem 0 0.4rem; width: 100%; }
.step {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem 1.05rem;
  box-shadow: var(--shadow);
}
.step p { max-width: none; margin-bottom: 0; }
.step-num {
  display: inline-flex; align-items: center; justify-content: center;
  width: 1.7rem; height: 1.7rem;
  border-radius: 8px;
  background: var(--brand);
  color: #fff;
  font-size: 0.85rem;
  font-weight: 700;
  margin-right: 0.45rem;
}
.panel, .calc-card, .form-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.15rem;
  width: 100%;
}
.calc-card h2, .form-card h2 { margin-top: 0; font-size: 1.3rem; }
.form-card p, .calc-card p { max-width: none; }

/* Tables */
.table-wrap { overflow-x: auto; margin: 0 0 1.2rem; width: 100%; }
table {
  width: 100%;
  border-collapse: collapse;
  background: var(--card);
  font-size: 0.98rem;
}
th, td {
  text-align: left;
  padding: 0.7rem 0.8rem;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
th { background: var(--brand); color: #fff; font-weight: 600; }
td.num, th.num { text-align: right; white-space: nowrap; }
.caption, figcaption, .source {
  font-size: 0.86rem;
  color: var(--ink-soft);
  margin: 0.35rem 0 1.2rem;
}
.callout {
  border-left: 4px solid var(--accent);
  background: #eef7f6;
  padding: 0.9rem 1rem;
  margin: 0 0 1.2rem;
  border-radius: 0 var(--radius) var(--radius) 0;
}

/* Form */
label { display: block; font-weight: 650; margin: 0 0 0.3rem; }
.hint { display: block; font-weight: 400; color: var(--ink-soft); font-size: 0.86rem; margin: 0 0 0.45rem; }
input, select, textarea {
  width: 100%;
  font: inherit;
  color: var(--ink);
  background: #fff;
  border: 1.5px solid #c5c3ce;
  border-radius: 8px;
  padding: 0.7rem 0.75rem;
  margin-bottom: 0.9rem;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--accent);
  outline: 3px solid rgba(11, 110, 106, 0.28);
}
.choice-grid { display: grid; gap: 0.55rem; margin: 0 0 1rem; }
.choice {
  display: flex; align-items: flex-start; gap: 0.6rem;
  border: 1.5px solid var(--line);
  border-radius: 8px;
  padding: 0.8rem;
  background: #fff;
  cursor: pointer;
}
.choice:has(input:checked) {
  border-color: var(--accent);
  background: var(--accent-soft);
}
.choice input { width: auto; margin: 0.15rem 0 0; }
.consent {
  display: flex; gap: 0.65rem; align-items: flex-start;
  background: #f3eef8;
  border: 1.5px solid var(--line);
  border-radius: 8px;
  padding: 0.85rem;
  margin: 0.4rem 0 1rem;
  font-size: 0.92rem;
  line-height: 1.45;
}
.consent input { width: auto; margin-top: 0.2rem; flex: 0 0 auto; }
.hp { position: absolute; left: -9999px; height: 0; overflow: hidden; }
.progress { display: flex; gap: 0.35rem; margin: 0 0 1rem; }
.progress span {
  flex: 1; height: 6px; border-radius: 99px; background: var(--paper-deep);
}
.progress span.on { background: var(--accent); }
.step-panel { display: none; }
.step-panel.on { display: block; }
.form-error {
  background: var(--err-bg);
  color: var(--err);
  border-radius: 8px;
  padding: 0.6rem 0.75rem;
  margin: 0 0 0.8rem;
  display: none;
}
.form-error.on { display: block; }
.form-nav { display: flex; gap: 0.6rem; flex-wrap: wrap; }

/* Sticky mobile CTA */
.sticky-cta {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  background: var(--brand);
  color: #f8f5fc;
  padding: 0.65rem 0.9rem calc(0.65rem + env(safe-area-inset-bottom));
  display: flex; gap: 0.6rem; align-items: center; justify-content: space-between;
  z-index: 50;
  box-shadow: 0 -6px 20px rgba(28, 21, 36, 0.18);
}
.sticky-cta p { margin: 0; font-size: 0.82rem; color: #e8dff3; max-width: none; }
.sticky-cta .btn { padding: 0.65rem 0.95rem; }
body { padding-bottom: 4.8rem; }

/* Footer */
.site-footer {
  background: var(--brand);
  color: #e8dff3;
  margin-top: 2rem;
  padding: 2rem 0 6.5rem;
  font-size: 0.92rem;
}
.footer-inner { padding: 0 var(--gutter); width: 100%; }
.site-footer a { color: #d7c8e6; }
.site-footer a:hover { color: #fff; }
.footer-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.3rem 1.4rem;
  margin-bottom: 1.4rem;
}
.footer-grid p { max-width: none; }
.footer-grid .brand-col { grid-column: 1 / -1; }
.footer-grid strong { display: block; color: #fff; margin-bottom: 0.35rem; font-size: 0.82rem; letter-spacing: 0.06em; text-transform: uppercase; }
.footer-grid a { display: block; padding: 0.12rem 0; text-decoration: none; }
.disclaimer {
  border-top: 1px solid rgba(255,255,255,0.15);
  padding-top: 1rem;
  color: #cfc6db;
  font-size: 0.84rem;
}

/* Clusters / chips */
.chips { display: flex; flex-wrap: wrap; gap: 0.45rem; margin: 0 0 1.2rem; }
.chip {
  display: inline-block;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.35rem 0.7rem;
  text-decoration: none;
  color: var(--brand);
  font-size: 0.88rem;
}
.related { display: grid; gap: 0.75rem; margin: 0 0 1.5rem; width: 100%; }
.related a {
  display: block;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.95rem 1rem;
  text-decoration: none;
  color: var(--brand);
}
.related a:hover { border-color: var(--accent); }
.related small { display: block; color: var(--ink-soft); font-weight: 400; margin-top: 0.25rem; }

/* FAQ */
.faq details {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.7rem 0.9rem;
  margin: 0 0 0.55rem;
}
.faq summary { font-weight: 650; cursor: pointer; color: var(--brand); }

.breadcrumbs { font-size: 0.88rem; color: var(--ink-soft); margin: 0 0 1rem; }
.breadcrumbs a { color: var(--ink-soft); }

.calc-result {
  background: var(--accent-soft);
  border: 1px solid #b7dedb;
  border-radius: var(--radius);
  padding: 0.9rem;
  margin: 0.4rem 0 0.9rem;
}
.calc-result .figure {
  font-family: var(--display);
  font-size: 2rem;
  color: var(--brand);
  line-height: 1.1;
}
.inline-cta {
  background: var(--brand);
  color: #f8f5fc;
  border-radius: var(--radius);
  padding: 1.15rem 1.2rem;
  margin: 1.6rem 0;
  width: 100%;
}
.inline-cta h2, .inline-cta p { color: #f8f5fc; }
.inline-cta p { color: #e8dff3; max-width: none; }
.inline-cta .btn { background: var(--accent); }

/* Self-employed hub — typographic list, not an industry-tile grid */
.se-hub-intro { display: grid; gap: 1.25rem; width: 100%; }
.se-directory { margin: 1.5rem 0 2rem; width: 100%; }
.se-directory h2 { margin-top: 0; }
.se-entry {
  border-top: 1px solid var(--line);
  padding: 1.1rem 0;
}
.se-entry:last-child { border-bottom: 1px solid var(--line); }
.se-entry a {
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--brand);
  text-decoration: none;
}
.se-entry a:hover { color: var(--accent); }
.se-entry p { margin: 0.35rem 0 0; max-width: none; color: var(--ink-soft); }

@media (min-width: 760px) {
  h1 { font-size: 2.55rem; }
  .header-meta { display: block; text-align: left; margin: 0 0 0 0.6rem; white-space: nowrap; }
  .nav-toggle { display: none; }
  .header-inner { flex-wrap: nowrap; }
  .site-nav {
    display: block;
    flex-basis: auto;
    background: transparent;
    margin: 0 0 0 auto;
    padding: 0;
  }
  .site-nav ul {
    display: flex;
    gap: 1.15rem;
    padding: 0;
    align-items: center;
  }
  .site-nav a { border: 0; padding: 0.2rem 0; font-size: 0.95rem; }
  .site-nav .btn { margin-top: 0; padding: 0.45rem 0.9rem; }
  .hero-grid { grid-template-columns: 1.15fr 0.85fr; align-items: start; padding-top: 2.2rem; padding-bottom: 2.6rem; }
  .trust-row { grid-template-columns: repeat(4, 1fr); }
  .steps { grid-template-columns: repeat(3, 1fr); }
  .footer-grid {
    grid-template-columns: 1.4fr 1fr 1fr 1fr 1fr;
    gap: 1.5rem 1.25rem;
  }
  .footer-grid .brand-col { grid-column: auto; }
  .related { grid-template-columns: 1fr 1fr; }
  body { padding-bottom: 0; }
  .sticky-cta { display: none; }
  .site-footer { padding-bottom: 2.2rem; }
  .choice-grid.two { grid-template-columns: 1fr 1fr; }
  .se-hub-intro { grid-template-columns: 1.15fr 0.85fr; align-items: start; }
}

@media (min-width: 1100px) {
  .footer-grid { grid-template-columns: 1.5fr repeat(6, 1fr); }
}

/* Progressive enhancement: all fields visible without JS */
.step-panel { display: block; }
.js .step-panel { display: none; }
.js .step-panel.on { display: block; }
.nojs-only { display: block; }
.js .nojs-only { display: none; }
.js-only { display: none; }
.js .js-only { display: block; }
.js .js-only.form-nav, .js .form-nav.js-only { display: flex; }

/* State directory */
.state-index {
  list-style: none;
  padding: 0;
  margin: 1.25rem 0 2rem;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.35rem 1.25rem;
  width: 100%;
}
@media (min-width: 700px) {
  .state-index { grid-template-columns: 1fr 1fr 1fr; }
}
.state-index a { display: block; padding: 0.2rem 0; }


/* Educational tax-cluster and worked-example patterns */
.takeaways {
  background: #efeaf6;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem 1.2rem;
  margin: 1.5rem 0 1.3rem;
  width: 100%;
}
.takeaways h2 { margin: 0 0 0.55rem; font-size: 1.15rem; }
.takeaways ul { margin: 0; padding-left: 1.2rem; }
.takeaways li { margin: 0 0 0.35rem; }
.example {
  background: var(--card);
  border: 1px solid var(--line);
  border-left: 4px solid var(--accent);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 1rem 1.15rem;
  margin: 1.3rem 0;
  width: 100%;
}
.example-label {
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--accent);
  margin: 0 0 0.3rem;
}
.example h3 { margin: 0 0 0.5rem; font-size: 1.15rem; }
.glossary {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem 1.2rem;
  margin: 1.4rem 0;
  width: 100%;
}
.glossary h2 { margin: 0 0 0.7rem; font-size: 1.15rem; }
.glossary dl { margin: 0; }
.glossary dt { font-weight: 700; color: var(--brand); margin-top: 0.65rem; }
.glossary dt:first-child { margin-top: 0; }
.glossary dd { margin: 0.2rem 0 0; color: var(--ink-soft); }
.howto { margin: 1.2rem 0; padding-left: 1.2rem; }
.howto li { margin: 0 0 0.55rem; }
