/* ==========================================================================
   Pro Bookkeepers - catch-up + e-commerce service pages (agent A layer).
   Loads after style.css on /services/catch-up-bookkeeping/ and
   /services/ecommerce-bookkeeping/ only. Homepage visual language, with
   sa- prefixed components so nothing collides with style.css.
   Colours are shell.css tokens only. Green/red = money in/out only.
   ========================================================================== */

.section h2 { font-size: var(--fs-h2); line-height: 1.02; }
.head { max-width: 760px; }
.sa-num, .sa-big, .sa-months, .sa-chain__t td, .sa-parts td, .sa-check-row b { font-variant-numeric: tabular-nums; font-feature-settings: "tnum"; }

/* Homepage-style section head: headline left, intro right */
.sa-head { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 1rem 2.5rem; align-items: end; margin-bottom: clamp(2rem, 4.5vw, 3.25rem); }
.sa-head h2 { margin: 0; max-width: 20ch; }
.sa-head .lead { margin: 0; max-width: 46ch; }
.section--ink .sa-head .lead { color: #9DAAB9; }
.sa-link { font-weight: 600; font-size: .9375rem; margin: 1rem 0 0; }

/* ---------- App-window panel ("stage") ---------- */
.sa-stage { position: relative; background: #fff; border: 1px solid var(--line); border-radius: 18px; box-shadow: 0 30px 60px -40px rgba(13,27,42,.45); overflow: hidden; margin: 0; color: var(--slate); }
.sa-stage__bar { display: flex; align-items: center; gap: .55rem; padding: .75rem 1rem; border-bottom: 1px solid var(--line); background: #F8FAFB; font: 600 .8125rem/1.2 var(--sans); color: var(--ink); }
.sa-stage__ico { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 8px; background: var(--ink); color: var(--accent); flex: none; }
.sa-stage__ico svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.sa-chip { margin-left: auto; flex: none; font: 600 .75rem/1 var(--sans); padding: .4rem .55rem; border-radius: 6px; background: var(--surface); color: var(--slate); white-space: nowrap; }
.sa-chip--live { display: inline-flex; align-items: center; gap: .35rem; background: none; color: var(--accent-dark); padding-inline: 0; }
.sa-chip--live::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); animation: saPulse 2s infinite; }
@keyframes saPulse { 0% { box-shadow: 0 0 0 0 rgba(0,168,114,.5); } 70% { box-shadow: 0 0 0 7px rgba(0,168,114,0); } 100% { box-shadow: 0 0 0 0 rgba(0,168,114,0); } }
.sa-note { font: 400 .75rem/1.4 var(--sans); color: var(--muted); margin: 0; }
.sa-k { font: 600 .8125rem/1.3 var(--sans); color: var(--muted); margin: 0 0 .5rem; }
.sa-fine { font-size: .8125rem; color: var(--muted); margin: .9rem 0 0; }
.sa-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--positive); flex: none; }

/* ---------- Catch-up hero: statement chain ---------- */
.sa-chain__t { width: 100%; border-collapse: collapse; font-size: .875rem; }
.sa-chain__t th { text-align: left; font: 500 .75rem/1 var(--sans); color: var(--muted); padding: .9rem 1rem .6rem; }
.sa-chain__t td { padding: .7rem 1rem; border-top: 1px solid var(--line); color: var(--ink); }
.sa-chain__t th:nth-child(2), .sa-chain__t th:nth-child(3), .sa-chain__t td:nth-child(2), .sa-chain__t td:nth-child(3) { text-align: right; }
.sa-chain__t td:first-child { font-weight: 600; }
.sa-chain__t .sa-st { display: inline-block; font-size: .75rem; font-weight: 600; padding: .3rem .5rem; border-radius: 6px; background: #DDF3EA; color: var(--positive); white-space: nowrap; }
.sa-chain__t .is-break td { background: #FDF0EC; }
.sa-chain__t .is-break .sa-st, .sa-chain__t .is-bad .sa-st { background: #F9D9CF; color: var(--negative); }
.sa-chain__t .is-bad td:nth-child(2) { color: var(--negative); font-weight: 600; }
.sa-chain__foot { display: flex; align-items: center; gap: .5rem; padding: .9rem 1rem 2.2rem; margin: 0; border-top: 1px dashed var(--line); font-size: .875rem; color: var(--ink); font-weight: 500; }
.sa-chain__foot .sa-dot { background: var(--negative); }
.sa-stage > .sa-note { position: absolute; right: 1rem; bottom: .75rem; }
.sa-chain tbody tr { animation: saRise .45s var(--ease-out) both; }
.sa-chain tbody tr:nth-child(1) { animation-delay: .5s; }
.sa-chain tbody tr:nth-child(2) { animation-delay: .8s; }
.sa-chain tbody tr:nth-child(3) { animation-delay: 1.1s; }
.sa-chain tbody tr:nth-child(4) { animation-delay: 1.4s; }
.sa-chain .sa-chain__foot { animation: saRise .45s var(--ease-out) 1.9s both; }
@keyframes saRise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ---------- Working paper (problem sections on ink) ---------- */
.sa-wp { background: #fff; border: 1px solid #22364D; border-radius: 14px; overflow: hidden; color: var(--ink); }
.sa-wp__head, .sa-wp__row { display: grid; grid-template-columns: 4rem minmax(0, 1fr) minmax(0, 1.5fr); gap: 1.5rem; padding: 1.25rem 1.5rem; align-items: start; }
.sa-wp__head { background: #142740; color: #9DAAB9; font: 500 .8125rem/1 var(--sans); padding-block: .9rem; }
.sa-wp__row { border-top: 1px solid var(--line); }
.sa-wp__row:hover { background: #F8FAFB; }
.sa-wp__ref { font: 600 .875rem/1.6 var(--sans); color: var(--negative); }
.sa-wp__row h3 { font-size: var(--fs-h3); margin: 0; color: var(--ink) !important; }
.sa-wp__row p { margin: 0; color: var(--slate) !important; font-size: .9375rem; }
.sa-after { display: flex; flex-wrap: wrap; gap: 1rem 1.5rem; align-items: center; justify-content: space-between; margin-top: 1.75rem; }
.sa-after p { margin: 0; color: #9DAAB9; max-width: 56ch; }

/* ---------- Catch-up estimator ---------- */
.sa-est { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.25fr); gap: clamp(1.5rem, 4vw, 3rem); align-items: start; }
@media (min-width: 961px) { .sa-est__in { position: sticky; top: 100px; } }
.sa-est__in { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: clamp(1.4rem, 3vw, 2rem); }
.sa-slide { display: block; margin-bottom: 1.6rem; }
.sa-slide > span { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; font-size: .9375rem; font-weight: 600; color: var(--ink); margin-bottom: .6rem; }
.sa-slide b { font: 800 1.5rem/1 var(--display); color: var(--ink); font-variant-numeric: tabular-nums; }
.sa-slide input { width: 100%; accent-color: var(--accent-dark); height: 24px; cursor: pointer; margin: 0; }
.sa-slide small i { font-style: normal; }
.sa-slide small { display: flex; justify-content: space-between; font-size: .75rem; color: var(--muted); margin-top: .25rem; }
.sa-checks { border: 0; margin: 0; padding: 0; }
.sa-checks legend { font-size: .9375rem; font-weight: 600; color: var(--ink); margin-bottom: .6rem; padding: 0; }
.sa-check { display: flex; gap: .7rem; align-items: flex-start; padding: .8rem .9rem; margin-bottom: .5rem; background: #fff; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; font-size: .9375rem; color: var(--ink); line-height: 1.4; }
.sa-check:hover { border-color: var(--line-strong); }
.sa-check input { width: 18px; height: 18px; margin: .1rem 0 0; accent-color: var(--accent-dark); flex: none; cursor: pointer; }
.sa-check:has(input:checked) { border-color: var(--ink); }
.sa-est__body { padding: clamp(1.1rem, 2.5vw, 1.6rem); }
.sa-est__top { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 1.25rem; padding-bottom: 1.25rem; margin-bottom: 1.25rem; border-bottom: 3px double var(--ink); }
.sa-big { font: 800 clamp(2.1rem, 4vw, 2.9rem)/1 var(--display); color: var(--ink); margin: 0 0 .45rem; letter-spacing: -.01em; }
.sa-mid { font: 800 clamp(1.5rem, 2.6vw, 1.9rem)/1.05 var(--display); color: var(--ink); margin: 0 0 .45rem; }
.sa-sub { font-size: .875rem; color: var(--slate); margin: 0; line-height: 1.45; }
.sa-range { font-weight: 500; color: var(--slate); }
.sa-months { list-style: none; margin: 0 0 1.4rem; padding: 0; display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 4px; }
.sa-months li { margin: 0; display: grid; place-items: center; align-content: center; min-height: 38px; border-radius: 6px; background: #FDEEE9; color: var(--negative); font: 600 .6875rem/1.1 var(--sans); text-align: center; transition: background .3s, color .3s; }
.sa-months li small { display: block; font-size: .5625rem; font-weight: 500; opacity: .85; }
.sa-months.is-run li { background: #DDF3EA; color: var(--positive); }
.sa-factors { list-style: none; margin: 0 0 1.4rem; padding: 0; }
.sa-factors li { position: relative; margin: 0; padding: .6rem 0 .6rem 1.9rem; border-bottom: 1px solid var(--line); font-size: .9rem; color: var(--slate); line-height: 1.5; }
.sa-factors li b { color: var(--ink); font-weight: 600; }
.sa-factors li::before { content: ''; position: absolute; left: 0; top: .85rem; width: 14px; height: 14px; border-radius: 50%; border: 1.5px solid var(--line-strong); box-sizing: border-box; }
.sa-factors li.is-on::before { border-color: var(--ink); background: var(--ink); box-shadow: inset 0 0 0 3px #fff; }
.sa-factors li.is-off { color: var(--muted); }
.sa-factors li.is-off b { color: var(--muted); font-weight: 500; }
.sa-factors li.is-review::before { border-style: dashed; border-color: var(--accent-dark); }

/* Price band card that matches the estimate */
.sa-bands .card { position: relative; }
.sa-bands .card.is-match { border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink), 0 20px 40px -26px rgba(13,27,42,.4); }
.sa-bands .card.is-match::after { content: 'Your estimate'; position: absolute; top: -11px; left: 1.2rem; font: 600 .75rem/1 var(--sans); background: var(--accent); color: var(--ink); padding: .35rem .55rem; border-radius: 6px; }
.sa-bands .card p strong { font: 800 1.6rem/1.1 var(--display); letter-spacing: -.01em; }

/* ---------- E-commerce hero card as an app window ---------- */
.hero__card.sa-herocard { border-radius: 18px; border-color: var(--line); padding: 0; box-shadow: 0 30px 70px -40px rgba(13,27,42,.45); background: #fff; }
.hero__card.sa-herocard::before { display: none; }
.sa-herocard .hero__card-title { justify-content: flex-start; margin: 0; padding: .8rem 1.1rem; border-bottom: 1px solid var(--line); background: #F8FAFB; font: 600 .875rem/1.2 var(--sans); gap: .55rem; }
.sa-herocard .hero__card-title::after { display: none; }
.sa-herocard .ledger { margin: .4rem 1.1rem 0; width: calc(100% - 2.2rem); }
.sa-herocard .hero__card-foot { margin: 0; padding: .9rem 1.1rem 1.1rem; }

/* ---------- Payout splitter ---------- */
.sa-split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: clamp(1.5rem, 4vw, 3rem); align-items: start; }
.sa-tabs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; padding: 5px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; margin-bottom: 1.25rem; }
.sa-tabs button { font: 600 .9375rem/1.2 var(--sans); color: var(--slate); background: none; border: 0; border-radius: 8px; padding: .7rem .4rem; cursor: pointer; transition: background .15s, color .15s; }
.sa-tabs button:hover { color: var(--ink); background: #fff; }
.sa-tabs button[aria-pressed="true"] { background: var(--ink); color: #fff; }
.sa-parts { width: 100%; border-collapse: collapse; font-size: .9rem; }
.sa-parts th { text-align: left; font: 500 .75rem/1 var(--sans); color: var(--muted); padding: 0 0 .6rem; border-bottom: 1px solid var(--line); }
.sa-parts th:last-child, .sa-parts td:last-child { text-align: right; }
.sa-parts td { padding: .6rem 0; border-bottom: 1px solid var(--line); color: var(--ink); vertical-align: top; }
.sa-parts tbody td:nth-child(2) { color: var(--slate); font-size: .8125rem; padding-inline: .75rem; }
.sa-parts td.in { color: var(--positive); }
.sa-parts td.out { color: var(--negative); }
.sa-parts tfoot td { border-bottom: 3px double var(--ink); font-weight: 700; }
.sa-parts tbody tr { animation: saRise .35s var(--ease-out) both; }
.sa-check-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-top: 1rem; padding: .8rem 1rem; border-radius: 10px; background: #DDF3EA; color: var(--positive); font-size: .875rem; font-weight: 600; }
.sa-check-row.is-bad { background: #F9D9CF; color: var(--negative); }
.sa-wrong { margin-top: 1rem; padding: 1rem 1.1rem; border-radius: 10px; border: 1px dashed var(--line-strong); font-size: .9rem; color: var(--slate); }
.sa-wrong b { color: var(--ink); }
.sa-flow-wrap { padding: 1rem 1rem 2.2rem; }
.sa-flow { display: block; width: 100%; height: auto; font-family: var(--sans); overflow: visible; }
.sa-flow__p { fill: none; stroke: var(--accent); stroke-width: 2; stroke-dasharray: 1; stroke-dashoffset: 1; animation: saDraw .7s ease-out forwards; }
.sa-flow__p--out { stroke: var(--negative); opacity: .7; }
.sa-flow__p--liab { stroke: var(--ink-600); opacity: .6; }
.sa-flow__src { fill: var(--ink); }
.sa-flow__srck { fill: #9DAAB9; font-size: 12px; }
.sa-flow__srcv { fill: #fff; font-size: 17px; font-weight: 700; font-variant-numeric: tabular-nums; }
.sa-flow__n { opacity: 0; animation: saFade .35s ease forwards; }
.sa-flow__n rect { fill: var(--accent-soft); }
.sa-flow__n--out rect { fill: #FDEEE9; }
.sa-flow__n--liab rect { fill: var(--surface-2); }
.sa-flow__n text { fill: var(--slate); font-size: 12px; }
.sa-flow__n text.v { fill: var(--positive); font-size: 14px; font-weight: 700; font-variant-numeric: tabular-nums; }
.sa-flow__n--out text.v { fill: var(--negative); }
.sa-flow__n--liab text.v { fill: var(--ink); }
@keyframes saDraw { to { stroke-dashoffset: 0; } }
@keyframes saFade { to { opacity: 1; } }

/* ---------- FAQ beside its heading, as on the homepage ---------- */
.sa-faq-wrap { display: grid; grid-template-columns: minmax(0, .75fr) minmax(0, 1.45fr); gap: clamp(2rem, 5vw, 4rem); align-items: start; }
.sa-faq-wrap .faq { margin: 0; max-width: none; }
.sa-faq-wrap h2 { max-width: 14ch; }
.sa-faq-side { position: sticky; top: 100px; }
.sa-faq-side p { color: var(--slate); }

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .sa-head, .sa-est, .sa-split, .sa-faq-wrap { grid-template-columns: minmax(0, 1fr); }
  .sa-faq-side { position: static; }
  .sa-wp__head { display: none; }
  .sa-wp__row { grid-template-columns: 3rem minmax(0, 1fr); gap: .4rem 1rem; }
  .sa-wp__row p { grid-column: 2; }
}
@media (max-width: 600px) {
  .sa-months { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .sa-est__top { grid-template-columns: minmax(0, 1fr); }
  .sa-chain__t th, .sa-chain__t td { padding-inline: .6rem; }
  .sa-chain__t { font-size: .8125rem; }
  .sa-wp__row { padding: 1.1rem; }
  .btn-row .btn { white-space: normal; }
}
@media (max-width: 400px) { .sa-tabs { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (prefers-reduced-motion: reduce) {
  .sa-chain tbody tr, .sa-chain .sa-chain__foot, .sa-parts tbody tr, .sa-flow__n { animation: none; opacity: 1; }
  .sa-flow__p { animation: none; stroke-dashoffset: 0; }
  .sa-chip--live::before { animation: none; }
  .sa-months li { transition: none !important; }
}
/* Phone widths: the statement chain must fit its card rather than be clipped by overflow:hidden */
@media (max-width: 440px) {
  .sa-chain__t { font-size: .75rem; }
  .sa-chain__t th, .sa-chain__t td { padding-left: .45rem; padding-right: .45rem; }
  .sa-chain__t .sa-st { white-space: normal; font-size: .6875rem; line-height: 1.2; }
}
@media (max-width: 359px) { .sa-stage.sa-chain { overflow-x: auto; } }  /* 320px phones: scroll, never clip */
