/* ============================================================
   TenantSync UK — Blog styles
   ------------------------------------------------------------
   Loaded *after* /styles.css, which supplies the brand tokens,
   nav, buttons, footer, waitlist form and toast.

   1.  Layout shell (hub + article)
   2.  Reading progress & breadcrumbs
   3.  Article typography
   4.  Callout blocks, tables, steps, FAQ
   5.  Conversion blocks (CTA cards, waitlist, asset tool)
   6.  Sticky mobile CTA
   7.  Responsive + print + reduced motion
   ============================================================ */

:root {
  --amber-50:  #fffbeb;
  --amber-200: #fde68a;
  --amber-700: #b45309;
  --rose-50:   #fff1f2;
  --rose-200:  #fecdd3;
  --rose-700:  #be123c;
  --sky-50:    #f0f9ff;
  --sky-200:   #bae6fd;
  --sky-700:   #0369a1;
  --prose:     72ch;
}

/* ============================================================
   1. Layout shell
   ============================================================ */

.blog-body { background: var(--white); }

.blog-hero {
  position: relative;
  padding: 56px 0 44px;
  background: radial-gradient(120% 120% at 50% -20%, var(--teal-50), var(--white) 60%);
  border-bottom: 1px solid var(--slate-200);
}

.blog-hero__inner { max-width: 780px; }
.blog-hero h1 {
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 800;
  margin-top: 16px;
}
.blog-hero__lead {
  margin-top: 18px;
  font-size: clamp(1.02rem, 2vw, 1.18rem);
  color: var(--slate-600);
  max-width: 62ch;
}

/* Article page shell: content + sticky sidebar */
.article-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 56px;
  align-items: start;
  padding: 44px 0 80px;
}

.article-main { min-width: 0; }

.article-aside {
  position: sticky;
  top: 92px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* ============================================================
   2. Reading progress & breadcrumbs
   ============================================================ */

.progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 100%;
  background: transparent;
  z-index: 60;
  pointer-events: none;
}
.progress__bar {
  height: 100%;
  width: 0;
  background: var(--gradient);
  transform-origin: left;
  transition: width .12s linear;
}

.breadcrumb {
  padding: 18px 0 0;
  font-size: .84rem;
  color: var(--slate-500);
}
.breadcrumb ol {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.breadcrumb li { display: inline-flex; align-items: center; gap: 8px; }
.breadcrumb li + li::before { content: "/"; color: var(--slate-400); }
.breadcrumb a { color: var(--slate-500); border-bottom: 1px solid transparent; }
.breadcrumb a:hover { color: var(--teal-700); border-bottom-color: var(--teal-400); }
.breadcrumb [aria-current="page"] { color: var(--slate-700); font-weight: 600; }

/* ============================================================
   3. Article typography
   ============================================================ */

.article-head { padding: 26px 0 8px; }

.article-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
  font-size: .84rem;
  color: var(--slate-500);
}
.article-meta__cat {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: .74rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--teal-700);
  background: var(--teal-50);
  border: 1px solid var(--teal-100);
  padding: 5px 11px;
  border-radius: var(--radius-pill);
}
.article-meta__dot { color: var(--slate-300, #cbd5e1); }

.article-title {
  font-size: clamp(2rem, 4.6vw, 3.05rem);
  font-weight: 800;
  margin-top: 20px;
  max-width: 22ch;
}

.article-standfirst {
  margin-top: 20px;
  font-size: clamp(1.05rem, 2.1vw, 1.22rem);
  line-height: 1.65;
  color: var(--slate-600);
  max-width: var(--prose);
}

.article-byline {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 26px;
  padding-top: 22px;
  border-top: 1px solid var(--slate-200);
}
.article-byline__mark {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: var(--teal-50);
  border: 1px solid var(--teal-100);
  padding: 5px;
  flex: none;
}
.article-byline__name { font-family: var(--font-head); font-weight: 700; color: var(--slate-900); font-size: .95rem; }
.article-byline__role { font-size: .84rem; color: var(--slate-500); }

/* Prose */
.prose { max-width: var(--prose); font-size: 1.045rem; line-height: 1.75; color: var(--slate-700); }
.prose > * + * { margin-top: 1.15em; }

.prose h2 {
  font-size: clamp(1.5rem, 3vw, 1.95rem);
  font-weight: 800;
  margin-top: 2.4em;
  padding-top: .3em;
  scroll-margin-top: 96px;
}
.prose h3 {
  font-size: clamp(1.16rem, 2.2vw, 1.32rem);
  font-weight: 700;
  margin-top: 1.9em;
  scroll-margin-top: 96px;
}
.prose h4 {
  font-family: var(--font-head);
  font-size: 1.02rem;
  font-weight: 700;
  color: var(--slate-900);
  margin-top: 1.6em;
}

.prose p { margin-bottom: 0; }
.prose strong { color: var(--slate-900); font-weight: 650; }
.prose em { color: var(--slate-700); }

.prose a:not(.btn):not(.cta-card__btn) {
  color: var(--teal-700);
  font-weight: 550;
  border-bottom: 1px solid var(--teal-200, #99f6e4);
  transition: border-color .18s ease, color .18s ease;
}
.prose a:not(.btn):not(.cta-card__btn):hover { color: var(--teal-600); border-bottom-color: var(--teal-500); }

.prose ul, .prose ol { padding-left: 1.35em; }
.prose ul { list-style: disc; }
.prose ol { list-style: decimal; }
.prose li { margin-top: .5em; }
.prose li::marker { color: var(--teal-600); }

.prose blockquote {
  margin-left: 0;
  margin-right: 0;
  padding: 4px 0 4px 22px;
  border-left: 3px solid var(--teal-500);
  color: var(--slate-600);
  font-size: 1.06rem;
}
.prose blockquote cite { display: block; margin-top: 10px; font-size: .86rem; font-style: normal; color: var(--slate-500); }

.prose code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: .88em;
  background: var(--slate-100);
  border: 1px solid var(--slate-200);
  border-radius: 6px;
  padding: 2px 6px;
}

.prose hr { border: 0; border-top: 1px solid var(--slate-200); margin: 2.6em 0; }

.section-anchor { scroll-margin-top: 96px; }

/* ============================================================
   4. Callouts, tables, steps, FAQ
   ============================================================ */

.callout {
  border-radius: var(--radius);
  border: 1px solid var(--slate-200);
  background: var(--slate-50);
  padding: 22px 24px;
  margin-top: 1.8em;
}
.callout > h4:first-child,
.callout > h3:first-child { margin-top: 0; }
.callout > * + * { margin-top: .8em; }
.callout p, .callout li { font-size: .98rem; }
.callout ul, .callout ol { padding-left: 1.25em; }
.callout ul { list-style: disc; }
.callout ol { list-style: decimal; }
.callout li { margin-top: .45em; }

.callout--answer {
  background: linear-gradient(140deg, var(--teal-50), var(--white) 70%);
  border-color: var(--teal-100);
  border-left: 4px solid var(--teal-600);
}
.callout--answer .callout__label {
  display: inline-block;
  font-family: var(--font-head);
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--teal-700);
  margin-bottom: 10px;
}
.callout--answer p { font-size: 1.06rem; color: var(--slate-700); }

.callout--warn { background: var(--amber-50); border-color: var(--amber-200); border-left: 4px solid #f59e0b; }
.callout--warn h4 { color: var(--amber-700); }

.callout--risk { background: var(--rose-50); border-color: var(--rose-200); border-left: 4px solid #f43f5e; }
.callout--risk h4 { color: var(--rose-700); }

.callout--info { background: var(--sky-50); border-color: var(--sky-200); border-left: 4px solid #0ea5e9; }
.callout--info h4 { color: var(--sky-700); }

.callout--key { background: var(--navy-900); border-color: var(--navy-700); color: rgba(255,255,255,.78); }
.callout--key h3, .callout--key h4 { color: var(--white); }
.callout--key strong { color: var(--white); }
.callout--key li::marker { color: var(--teal-400); }

/* Key-takeaways list — beats the generic `.callout ul` disc rule */
.callout ul.takeaways,
.takeaways { list-style: none; padding-left: 0; }
.takeaways li {
  position: relative;
  padding-left: 30px;
  margin-top: .7em;
}
.takeaways li::before {
  content: "";
  position: absolute;
  left: 0;
  top: .55em;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--gradient);
  box-shadow: 0 0 0 4px rgba(20,184,166,.14);
}

/* Tables — always scrollable on small screens */
.table-wrap {
  margin-top: 1.8em;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--slate-200);
  border-radius: var(--radius);
  background: var(--white);
}
.table-wrap { position: relative; }
.table-wrap table { width: 100%; border-collapse: collapse; font-size: .94rem; min-width: 540px; }

/* Affordance so nobody misses a column on a phone */
.table-hint {
  display: none;
  align-items: center;
  gap: 6px;
  margin-top: .9em;
  font-size: .82rem;
  font-weight: 600;
  color: var(--teal-700);
  background: var(--teal-50);
  border: 1px solid var(--teal-100);
  border-radius: var(--radius-pill);
  padding: 6px 14px;
  width: fit-content;
  transition: opacity .25s ease;
}
.table-wrap.is-scrollable + .table-hint { display: inline-flex; }
.table-wrap.is-scrolled + .table-hint { opacity: 0; }
.table-wrap caption {
  caption-side: bottom;
  text-align: left;
  padding: 12px 16px;
  font-size: .82rem;
  color: var(--slate-500);
  border-top: 1px solid var(--slate-200);
}
.table-wrap th, .table-wrap td { padding: 13px 16px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--slate-200); }
.table-wrap thead th {
  font-family: var(--font-head);
  font-size: .78rem;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--slate-600);
  background: var(--slate-50);
  white-space: nowrap;
}
.table-wrap tbody tr:last-child td { border-bottom: 0; }
.table-wrap tbody tr:hover { background: var(--teal-50); }
.table-wrap td strong { color: var(--slate-900); }

.pill-tag {
  display: inline-block;
  font-size: .74rem;
  font-weight: 700;
  font-family: var(--font-head);
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  white-space: nowrap;
}
.pill-tag--yes { background: #ecfdf5; color: #047857; border: 1px solid #a7f3d0; }
.pill-tag--no  { background: var(--rose-50); color: var(--rose-700); border: 1px solid var(--rose-200); }
.pill-tag--maybe { background: var(--amber-50); color: var(--amber-700); border: 1px solid var(--amber-200); }

/* Numbered operating-model steps */
.op-steps { list-style: none; padding-left: 0; counter-reset: op; margin-top: 1.6em; }
.op-steps > li {
  counter-increment: op;
  position: relative;
  padding: 22px 24px 22px 68px;
  border: 1px solid var(--slate-200);
  border-radius: var(--radius);
  background: var(--white);
  margin-top: 14px;
  transition: box-shadow .2s ease, border-color .2s ease, transform .2s ease;
}
.op-steps > li:hover { box-shadow: var(--shadow-md); border-color: var(--teal-100); transform: translateY(-2px); }
.op-steps > li::before {
  content: counter(op);
  position: absolute;
  left: 22px;
  top: 22px;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 10px;
  background: var(--gradient);
  color: var(--white);
  font-family: var(--font-head);
  font-weight: 800;
  font-size: .95rem;
  box-shadow: 0 8px 16px -8px rgba(13,148,136,.65);
}
.op-steps h3 { margin-top: 0; font-size: 1.08rem; }
.op-steps p { margin-top: .55em; font-size: .98rem; color: var(--slate-600); }

/* Status cards (unregistered / pending / active) */
.status-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 1.8em; }
.status-card {
  border: 1px solid var(--slate-200);
  border-top: 4px solid var(--slate-400);
  border-radius: var(--radius);
  padding: 22px 20px;
  background: var(--white);
}
.status-card--no { border-top-color: #f43f5e; }
.status-card--pending { border-top-color: #f59e0b; }
.status-card--go { border-top-color: var(--teal-500); }
.status-card h4 { margin-top: 0; font-size: 1.02rem; }
.status-card p { margin-top: .6em; font-size: .93rem; color: var(--slate-600); }
.status-card__flag {
  display: inline-block;
  margin-top: 14px;
  font-family: var(--font-head);
  font-weight: 800;
  font-size: .76rem;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.status-card--no .status-card__flag { color: var(--rose-700); }
.status-card--pending .status-card__flag { color: var(--amber-700); }
.status-card--go .status-card__flag { color: var(--teal-700); }

/* Three-way reconciliation diagram (client money guide) */
.recon-diagram {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: stretch;
  gap: 10px;
  margin: 1.8em 0;
}
.recon-diagram__box {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 18px 18px 20px;
  background: var(--white);
  border: 1px solid var(--slate-200);
  border-top: 4px solid var(--teal-500);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.recon-diagram__box strong { font-family: var(--font-head); font-size: 1rem; color: var(--slate-900); line-height: 1.3; }
.recon-diagram__box > span:last-child { font-size: .88rem; color: var(--slate-600); line-height: 1.5; }
.recon-diagram__eyebrow {
  font-family: var(--font-head);
  font-weight: 800;
  font-size: .72rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--teal-700);
}
.recon-diagram__eq {
  align-self: center;
  font-family: var(--font-head);
  font-weight: 800;
  font-size: 1.6rem;
  color: var(--teal-600);
}

/* Scenario cards (periodic-tenancy traps) */
.scenario-list { display: grid; gap: 18px; margin-top: 1.6em; }
.scenario {
  padding: 22px 24px;
  background: var(--white);
  border: 1px solid var(--slate-200);
  border-left: 4px solid var(--amber-700);
  border-radius: var(--radius);
}
.scenario h3 { display: flex; gap: 12px; align-items: flex-start; margin-top: 0; font-size: 1.08rem; }
.scenario__n {
  flex: none;
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--amber-50);
  border: 1px solid var(--amber-200);
  color: var(--amber-700);
  font-size: .85rem;
  font-weight: 800;
}
.scenario p { margin-top: .7em; font-size: .97rem; color: var(--slate-700); }
.scenario__fix {
  margin-top: 1em !important;
  padding: 10px 14px;
  background: var(--teal-50);
  border-radius: 10px;
  color: var(--teal-700) !important;
}

/* FAQ — kept fully visible so it stays extractable by search and AI engines */
.faq { margin-top: 1.6em; }
.faq__item {
  border-bottom: 1px solid var(--slate-200);
  padding: 22px 0;
}
.faq__item:first-child { border-top: 1px solid var(--slate-200); }
.faq__q { font-family: var(--font-head); font-size: 1.06rem; font-weight: 700; color: var(--slate-900); margin: 0; }
.faq__a { margin-top: .6em; font-size: .99rem; color: var(--slate-600); }

/* Source list */
.sources { font-size: .93rem; }
.sources li { margin-top: .6em; }

/* Sidebar cards */
.aside-card {
  border: 1px solid var(--slate-200);
  border-radius: var(--radius);
  background: var(--white);
  padding: 20px;
}
.aside-card__title {
  font-family: var(--font-head);
  font-size: .74rem;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--slate-500);
  margin: 0 0 14px;
}

.toc { max-height: min(52vh, 520px); overflow-y: auto; }
.toc ol { list-style: none; padding: 0; margin: 0; counter-reset: toc; }
.toc li { counter-increment: toc; }
.toc a {
  display: block;
  padding: 7px 10px 7px 12px;
  font-size: .89rem;
  line-height: 1.4;
  color: var(--slate-600);
  border-left: 2px solid var(--slate-200);
  transition: color .16s ease, border-color .16s ease, background .16s ease;
}
.toc a:hover { color: var(--slate-900); background: var(--slate-50); }
.toc a.is-active { color: var(--teal-700); border-left-color: var(--teal-500); font-weight: 650; background: var(--teal-50); }

.aside-cta {
  background: var(--navy-900);
  border-color: var(--navy-700);
  color: rgba(255,255,255,.72);
}
.aside-cta h3 { color: var(--white); font-size: 1.05rem; }
.aside-cta p { margin-top: 10px; font-size: .9rem; }
.aside-cta .btn { width: 100%; margin-top: 16px; }
.aside-cta .waitlist { margin-top: 16px; }
.aside-cta .waitlist__field { flex-direction: column; padding: 10px; gap: 8px; border-radius: var(--radius); }
.aside-cta .waitlist__field .btn { width: 100%; margin-top: 0; }
.aside-cta .waitlist__note { color: rgba(255,255,255,.55); font-size: .78rem; }
.aside-cta .waitlist__note.is-success { color: var(--teal-400); }
.aside-cta .waitlist__note.is-error { color: #fca5a5; }

/* Share row */
.share { display: flex; flex-wrap: wrap; gap: 10px; }
.share__btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: .84rem;
  font-weight: 600;
  color: var(--slate-600);
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-pill);
  padding: 8px 14px;
  background: var(--white);
  cursor: pointer;
  font-family: var(--font-body);
  transition: border-color .18s ease, color .18s ease, transform .18s ease;
}
.share__btn:hover { border-color: var(--teal-400); color: var(--teal-700); transform: translateY(-1px); }

/* ============================================================
   5. Conversion blocks
   ============================================================ */

.cta-card {
  margin-top: 2.2em;
  border-radius: var(--radius-lg);
  padding: 30px 30px;
  background: var(--navy-900);
  position: relative;
  overflow: hidden;
  color: rgba(255,255,255,.75);
}
.cta-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(520px 260px at 88% -20%, rgba(20,184,166,.30), transparent 70%),
    radial-gradient(420px 260px at 0% 120%, rgba(16,185,129,.18), transparent 70%);
  pointer-events: none;
}
.cta-card > * { position: relative; }
.cta-card__eyebrow {
  font-family: var(--font-head);
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--teal-400);
}
.cta-card h3 { color: var(--white); font-size: clamp(1.25rem, 2.6vw, 1.6rem); margin-top: 12px; }
.cta-card p { margin-top: 12px; font-size: 1rem; max-width: 54ch; }
.cta-card .waitlist { margin-top: 22px; max-width: 480px; }
.cta-card .waitlist__field { border-color: transparent; }
.cta-card .waitlist__note { color: rgba(255,255,255,.6); }
.cta-card .waitlist__note.is-success { color: var(--teal-400); }
.cta-card .waitlist__note.is-error { color: #fca5a5; }
.cta-card__points { display: flex; flex-wrap: wrap; gap: 8px 20px; margin-top: 18px; font-size: .86rem; color: rgba(255,255,255,.6); list-style: none; padding: 0; }
.cta-card__points li { margin-top: 0; }

/* Teal-on-navy is unreadable — links inside the dark card get their own treatment */
.prose .cta-card a:not(.btn):not(.cta-card__btn) {
  color: var(--teal-400);
  font-weight: 600;
  border-bottom-color: rgba(45,212,191,.5);
}
.prose .cta-card a:not(.btn):not(.cta-card__btn):hover { color: var(--white); border-bottom-color: var(--white); }

.cta-card--soft {
  background: linear-gradient(140deg, var(--teal-50), var(--white) 65%);
  border: 1px solid var(--teal-100);
  color: var(--slate-600);
}
.cta-card--soft::before { display: none; }
.cta-card--soft h3 { color: var(--slate-900); }
.cta-card--soft .cta-card__eyebrow { color: var(--teal-700); }
.cta-card--soft .waitlist__note { color: var(--slate-500); }
.cta-card--soft .waitlist__note.is-success { color: var(--teal-700); }

/* Interactive readiness audit */
.audit {
  margin-top: 1.8em;
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--white);
  box-shadow: var(--shadow-md);
}
.audit__head {
  padding: 24px 26px;
  background: var(--slate-50);
  border-bottom: 1px solid var(--slate-200);
}
.audit__head h3 { margin-top: 0; font-size: 1.2rem; }
.audit__head p { margin-top: 8px; font-size: .94rem; color: var(--slate-500); }
.audit__body { padding: 8px 26px 26px; }

.audit__item {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 16px 0;
  border-bottom: 1px solid var(--slate-100);
  cursor: pointer;
}
.audit__item:last-of-type { border-bottom: 0; }
.audit__item input {
  appearance: none;
  -webkit-appearance: none;
  flex: none;
  margin-top: 2px;
  width: 22px;
  height: 22px;
  border: 2px solid var(--slate-300, #cbd5e1);
  border-radius: 7px;
  background: var(--white);
  cursor: pointer;
  transition: background .16s ease, border-color .16s ease;
  position: relative;
}
.audit__item input:checked { background: var(--teal-600); border-color: var(--teal-600); }
.audit__item input:checked::after {
  content: "";
  position: absolute;
  left: 6px;
  top: 2px;
  width: 5px;
  height: 10px;
  border: solid var(--white);
  border-width: 0 2.5px 2.5px 0;
  transform: rotate(45deg);
}
.audit__item input:focus-visible { outline: 3px solid rgba(45,212,191,.45); outline-offset: 2px; }
.audit__label { font-size: .97rem; color: var(--slate-700); }
.audit__label span { display: block; margin-top: 4px; font-size: .86rem; color: var(--slate-500); }

.audit__result {
  margin-top: 22px;
  padding: 20px 22px;
  border-radius: var(--radius);
  background: var(--slate-50);
  border: 1px solid var(--slate-200);
}
.audit__score {
  font-family: var(--font-head);
  font-weight: 800;
  font-size: 1.6rem;
  color: var(--slate-900);
}
.audit__score span { color: var(--teal-600); }
.audit__verdict { margin-top: 8px; font-size: .96rem; color: var(--slate-600); }
.audit__meter {
  margin-top: 14px;
  height: 8px;
  border-radius: 99px;
  background: var(--slate-200);
  overflow: hidden;
}
.audit__meter i { display: block; height: 100%; width: 0; background: var(--gradient); border-radius: 99px; transition: width .35s cubic-bezier(.2,.8,.2,1); }
.audit__actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 20px; }

/* ------------------------------------------------------------
   Possession grounds: decision tree, notice checker, evidence pack
   ------------------------------------------------------------ */

.tree {
  margin-top: 1.8em;
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-lg);
  background: var(--white);
  box-shadow: var(--shadow-md);
  overflow: hidden;
}
.tree__head {
  padding: 24px 26px 20px;
  background: linear-gradient(140deg, var(--teal-50), var(--white) 70%);
  border-bottom: 1px solid var(--slate-200);
}
.tree__eyebrow {
  font-family: var(--font-head);
  font-size: .7rem;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--teal-700);
  margin: 0;
}
.tree__q { margin: 12px 0 0; font-size: clamp(1.12rem, 2.4vw, 1.3rem); font-weight: 700; color: var(--slate-900); }
.tree__hint { margin: 8px 0 0; font-size: .88rem; color: var(--slate-500); }
.tree__body { padding: 22px 26px 4px; }

/* `hidden` must beat the display rules below, or a toggled panel stays on screen */
.tree [hidden] { display: none !important; }

.tree__opts { display: grid; gap: 10px; }
.tree__opt {
  display: block;
  width: 100%;
  text-align: left;
  font-family: var(--font-body);
  font-size: .99rem;
  font-weight: 550;
  color: var(--slate-700);
  background: var(--white);
  border: 1px solid var(--slate-200);
  border-radius: var(--radius);
  padding: 15px 46px 15px 18px;
  cursor: pointer;
  position: relative;
  min-height: 48px;
  transition: border-color .18s ease, background .18s ease, transform .18s ease, box-shadow .18s ease;
}
.tree__opt::after {
  content: "→";
  position: absolute;
  right: 18px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--teal-600);
  font-weight: 700;
  transition: transform .18s ease;
}
.tree__opt:hover {
  border-color: var(--teal-400);
  background: var(--teal-50);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}
.tree__opt:hover::after { transform: translate(4px, -50%); }
.tree__opt:focus-visible { outline: 3px solid rgba(45,212,191,.45); outline-offset: 2px; }

.tree__note {
  margin: 0 0 16px;
  font-size: .96rem;
  color: var(--slate-700);
  background: var(--sky-50);
  border: 1px solid var(--sky-200);
  border-left: 4px solid #0ea5e9;
  border-radius: var(--radius);
  padding: 14px 16px;
}
.tree__disclaimer { margin: 14px 0 0; font-size: .82rem; color: var(--slate-500); }

.tree__nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding: 16px 26px 20px;
  border-top: 1px solid var(--slate-100);
}
.tree__crumbs { font-size: .8rem; color: var(--slate-500); flex: 1; min-width: 0; }

/* Result cards */
.ground-card {
  border: 1px solid var(--slate-200);
  border-left: 4px solid var(--teal-500);
  border-radius: var(--radius);
  padding: 20px 22px;
  background: var(--white);
}
.ground-card + .ground-card { margin-top: 14px; }
.ground-card--mandatory { border-left-color: #f43f5e; }
.ground-card--discretionary { border-left-color: #f59e0b; }
.ground-card__head { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; justify-content: space-between; }
.ground-card__head h4 { margin: 0; font-size: 1.05rem; }
.ground-card p { margin-top: .7em; font-size: .96rem; color: var(--slate-600); }
.ground-card__notice { font-size: .95rem; }
.ground-card__notice strong { color: var(--slate-900); }
.ground-card__flags { list-style: none; padding: 0; margin-top: .9em; display: grid; gap: 6px; }
.ground-card__flags li {
  font-size: .86rem;
  font-weight: 600;
  color: var(--rose-700);
  background: var(--rose-50);
  border: 1px solid var(--rose-200);
  border-radius: var(--radius-pill);
  padding: 5px 13px;
  width: fit-content;
  max-width: 100%;
  margin: 0;
}
.ground-card__ev { margin-top: 1em; border-top: 1px solid var(--slate-100); padding-top: .9em; }
.ground-card__ev summary {
  cursor: pointer;
  font-family: var(--font-head);
  font-weight: 700;
  font-size: .9rem;
  color: var(--teal-700);
  list-style: none;
}
.ground-card__ev summary::-webkit-details-marker { display: none; }
.ground-card__ev summary::before { content: "＋ "; font-weight: 800; }
.ground-card__ev[open] summary::before { content: "− "; }
.ground-card__ev ul { list-style: disc; padding-left: 1.25em; margin-top: .8em; }
.ground-card__ev li { font-size: .93rem; color: var(--slate-600); margin-top: .4em; }
.ground-card__after { font-size: .93rem; color: var(--slate-600); }

/* Notice date checker */
.calc {
  margin-top: 1.8em;
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-lg);
  background: var(--white);
  box-shadow: var(--shadow-md);
  padding: 24px 26px 22px;
}
.calc__grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; }
.calc__field { display: flex; flex-direction: column; gap: 7px; }
.calc__field > span {
  font-family: var(--font-head);
  font-size: .76rem;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--slate-500);
}
.calc__field select,
.calc__field input {
  font-family: var(--font-body);
  font-size: .98rem;
  color: var(--slate-900);
  background: var(--white);
  border: 1px solid var(--slate-200);
  border-radius: var(--radius);
  padding: 12px 14px;
  min-height: 48px;
  width: 100%;
}
.calc__field select:focus-visible,
.calc__field input:focus-visible { outline: 3px solid rgba(45,212,191,.45); outline-offset: 1px; border-color: var(--teal-400); }

.calc__out { margin-top: 20px; }
.calc__placeholder { font-size: .95rem; color: var(--slate-500); margin: 0; }
.calc__rows { display: grid; gap: 1px; background: var(--slate-200); border: 1px solid var(--slate-200); border-radius: var(--radius); overflow: hidden; margin: 0; }
.calc__rows > div { display: flex; flex-wrap: wrap; gap: 6px 16px; justify-content: space-between; background: var(--white); padding: 12px 16px; }
.calc__rows dt { font-size: .93rem; color: var(--slate-600); margin: 0; }
.calc__rows dd { margin: 0; font-family: var(--font-head); font-weight: 700; font-size: .95rem; color: var(--slate-900); }
.calc__rows > div:last-child { background: var(--teal-50); }
.calc__rows--plain > div:last-child { background: var(--white); }

.calc__flag { margin-top: 12px; font-size: .93rem; border-radius: var(--radius); padding: 12px 14px; border: 1px solid; }
.calc__flag--ok   { background: #ecfdf5; border-color: #a7f3d0; color: #047857; }
.calc__flag--warn { background: var(--amber-50); border-color: var(--amber-200); color: var(--amber-700); }
.calc__flag--bad  { background: var(--rose-50); border-color: var(--rose-200); color: var(--rose-700); }
.calc__note { margin-top: 16px; font-size: .84rem; color: var(--slate-500); }

/* Section 13 calculator extras */
.calc__hint { margin: 14px 0 0; font-size: .84rem; color: var(--slate-500); }
.calc__actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
/* `hidden` on the copy button must beat the flex display above */
.calc__actions [hidden] { display: none !important; }
.calc__rows dd strong { font-weight: 800; }

/* Evidence pack */
.chip-row { display: flex; flex-wrap: wrap; gap: 8px; padding: 18px 0 4px; }
.chip {
  font-family: var(--font-head);
  font-size: .84rem;
  font-weight: 700;
  color: var(--slate-600);
  background: var(--white);
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-pill);
  padding: 8px 15px;
  min-height: 38px;
  cursor: pointer;
  transition: border-color .16s ease, color .16s ease, background .16s ease;
}
.chip:hover { border-color: var(--teal-400); color: var(--teal-700); }
.chip.is-active { background: var(--teal-600); border-color: var(--teal-600); color: var(--white); }
.chip:focus-visible { outline: 3px solid rgba(45,212,191,.45); outline-offset: 2px; }

.evidence__head { padding: 18px 0 6px; border-bottom: 1px solid var(--slate-100); }
.evidence__head h4 { margin: 0; font-size: 1.05rem; }
.evidence__head p { margin-top: .6em; font-size: .93rem; color: var(--slate-600); display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.evidence__notice { color: var(--slate-600); }
.evidence__summary { display: block; }
.evidence__after { margin-top: 16px; font-size: .92rem; color: var(--slate-600); }

/* Printable one-page tree — only ever visible in a print context */
#tree-print { display: none; }

/* Printable one-page client notice — only ever visible in a print context */
#notice-print { display: none; }

/* Post cards on the hub */
.post-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(320px, 100%), 1fr)); gap: 24px; }
.post-card {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-lg);
  background: var(--white);
  padding: 28px 26px;
  transition: transform .22s ease, box-shadow .22s ease, border-color .22s ease;
}
.post-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); border-color: transparent; }
.post-card__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; font-size: .8rem; color: var(--slate-500); }
.post-card h3 { font-size: 1.24rem; margin-top: 14px; }
.post-card p { margin-top: 12px; font-size: .96rem; color: var(--slate-500); flex: 1; }
.post-card__more {
  margin-top: 20px;
  font-family: var(--font-head);
  font-weight: 700;
  font-size: .92rem;
  color: var(--teal-700);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.post-card:hover .post-card__more { gap: 10px; }

.post-card--upcoming { background: var(--slate-50); border-style: dashed; }
.post-card--upcoming:hover { transform: none; box-shadow: none; border-color: var(--slate-200); }
.post-card--upcoming h3 { font-size: 1.08rem; color: var(--slate-700); }

/* ============================================================
   6. Sticky mobile CTA
   ============================================================ */

.sticky-cta {
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: 12px;
  z-index: 55;
  display: none;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: var(--radius);
  background: var(--navy-900);
  box-shadow: 0 18px 40px -14px rgba(11,17,32,.7);
  transform: translateY(140%);
  transition: transform .3s cubic-bezier(.2,.8,.2,1);
}
.sticky-cta.is-visible { transform: none; }
.sticky-cta__text { flex: 1; min-width: 0; font-size: .86rem; color: rgba(255,255,255,.8); line-height: 1.35; }
.sticky-cta__text strong { display: block; color: var(--white); font-family: var(--font-head); font-size: .95rem; }
.sticky-cta .btn { flex: none; padding: 11px 18px; font-size: .88rem; }
.sticky-cta__close {
  flex: none;
  background: none;
  border: 0;
  color: rgba(255,255,255,.45);
  font-size: 1.15rem;
  line-height: 1;
  padding: 4px;
  cursor: pointer;
}
.sticky-cta__close:hover { color: var(--white); }

/* ============================================================
   7. Responsive, print, motion
   ============================================================ */

@media (max-width: 1080px) {
  .article-shell { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .article-aside { position: static; margin-top: 40px; }
  .article-aside .toc { max-height: none; }
}

@media (max-width: 760px) {
  .blog-hero { padding: 40px 0 32px; }
  .article-shell { padding: 28px 0 64px; }
  .prose { font-size: 1.02rem; }
  .status-grid { grid-template-columns: 1fr; }
  .recon-diagram { grid-template-columns: minmax(0, 1fr); gap: 4px; }
  .recon-diagram__eq { justify-self: center; line-height: 1; }
  .scenario { padding: 18px; }
  .op-steps > li { padding: 20px 20px 20px 20px; }
  .op-steps > li::before { position: static; margin-bottom: 12px; }
  .cta-card { padding: 26px 22px; }
  .audit__head, .audit__body { padding-left: 20px; padding-right: 20px; }
  .sticky-cta { display: flex; }
  .article-title { max-width: none; }

  .tree__head { padding: 20px 20px 16px; }
  .tree__body { padding: 18px 20px 4px; }
  .tree__nav { padding: 14px 20px 18px; }
  .tree__opt { padding: 14px 40px 14px 15px; font-size: .95rem; }
  .calc { padding: 20px; }
  .ground-card { padding: 18px; }

  /* Ground chips scroll horizontally rather than eating half the screen */
  .chip-row {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x proximity;
    padding-bottom: 10px;
    margin-right: -20px;
    padding-right: 20px;
  }
  .chip { flex: none; scroll-snap-align: start; }
}

@media (max-width: 520px) {
  /* Full-width, wrappable action buttons — easier to tap and safe at 320px. */
  .audit__actions { flex-direction: column; gap: 10px; }
  .audit__actions .btn,
  .audit__actions .share__btn { width: 100%; white-space: normal; text-align: center; justify-content: center; }
  .cta-card__points { gap: 6px 14px; font-size: .82rem; }

  .ground-card__head { flex-direction: column; align-items: flex-start; gap: 8px; }
  .calc__rows > div { flex-direction: column; gap: 2px; }
  .tree__nav .share__btn { flex: 1; justify-content: center; }
}

@media print {
  .nav, .footer, .article-aside, .cta-card, .sticky-cta, .progress, .share, .audit__actions, .toast,
  .tree, .calc, .chip-row { display: none !important; }
  .article-shell { display: block; padding: 0; }
  .prose { max-width: none; font-size: 11pt; color: #000; }
  .prose h2, .prose h3 { break-after: avoid; }
  .table-wrap { break-inside: avoid; border-color: #999; }
  .table-wrap table { min-width: 0; }
  .audit { box-shadow: none; break-inside: avoid; }
  .scenario, .recon-diagram__box { break-inside: avoid; box-shadow: none; }
  .ground-card__ev[open] summary::before { content: ""; }
  a[href^="http"]::after { content: " (" attr(href) ")"; font-size: 9pt; color: #555; word-break: break-all; }

  /* One-page client notice: print only the generated sheet */
  .print-notice-only > *:not(#notice-print) { display: none !important; }
  .print-notice-only #notice-print { display: block !important; font-size: 10pt; color: #000; }
  #notice-print h1 { font-family: var(--font-head); font-size: 15pt; margin: 0 0 4px; }
  #notice-print .notice-print__sub { font-size: 8pt; color: #555; margin: 0 0 14px; }
  #notice-print p { margin: 0 0 9px; line-height: 1.5; }
  #notice-print .notice-print__foot { font-size: 8pt; color: #333; margin-top: 12px; }

  /* One-page decision tree: print only the generated sheet */
  .print-tree-only > *:not(#tree-print) { display: none !important; }
  .print-tree-only #tree-print { display: block !important; font-size: 9.5pt; color: #000; }
  #tree-print h1 { font-family: var(--font-head); font-size: 15pt; margin: 0 0 4px; }
  #tree-print .tree-print__sub { font-size: 8pt; color: #555; margin: 0 0 12px; }
  #tree-print table { width: 100%; border-collapse: collapse; }
  #tree-print th, #tree-print td { border: 1px solid #999; padding: 5px 7px; text-align: left; vertical-align: top; }
  #tree-print thead th { background: #eee; font-size: 8.5pt; text-transform: uppercase; letter-spacing: .04em; }
  #tree-print tr { break-inside: avoid; }
  #tree-print .tree-print__note { font-size: 8pt; color: #333; margin-top: 10px; }
  @page { margin: 12mm; }
}

@media (prefers-reduced-motion: reduce) {
  .progress__bar, .audit__meter i, .sticky-cta, .tree__opt, .tree__opt::after { transition: none; }
}
