/* /pricing only (src/http/pricing.js). Loaded after /site.css and /connect.css, whose tokens it
   uses (--bg --panel --ink --muted --line --accent --action --brand --teal --code-bg, --cx-shadow
   --cx-ease --cx-field --cx-ring), so light and dark follow them. No inline
   styles anywhere: the page CSP is style-src 'self'. Layout holds at 390px with no sideways
   scroll. Motion is transform/opacity only and off under prefers-reduced-motion. */

.pricing-page { overflow-x: hidden; }
.top nav a[aria-current="page"] { color: var(--ink); font-weight: 650; }
.pricing h2 { margin-top: 0; }
.pricing > section { padding-top: 56px; }
.pricing > section.wrap > p.muted:first-of-type { margin-top: 0; max-width: 720px; }
.p-ic { width: 18px; height: 18px; flex: none; color: var(--accent); }
.p-ic.big { width: 22px; height: 22px; }

/* hero: a soft indigo glow (the mark's tile), the mark's teal bar as the KPI accent */
.p-hero {
  padding: 72px 0 8px !important;
  background:
    radial-gradient(900px 420px at 15% -140px, color-mix(in srgb, var(--action) 18%, transparent), transparent 70%),
    radial-gradient(700px 360px at 95% -80px, color-mix(in srgb, var(--teal) 16%, transparent), transparent 70%);
}
.p-hero h1 { font-size: clamp(2.3rem, 6vw, 4rem); letter-spacing: -.035em; max-width: 14em; margin-top: 8px; animation: cx-rise var(--cx-mid) var(--cx-ease) both; }
.p-hero .lead { margin-top: 0; }
.sandbox-line { display: inline-block; margin: 4px 0 0; padding: 8px 14px; border: 1px solid color-mix(in srgb, var(--teal) 45%, var(--line)); border-radius: 12px; background: color-mix(in srgb, var(--teal) 8%, var(--panel)); max-width: 860px; }
.kpis { list-style: none; padding: 0; margin: 24px 0 4px; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; max-width: 860px; }
.kpis li {
  background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 14px 16px; min-width: 0;
  box-shadow: var(--cx-shadow); animation: cx-rise var(--cx-mid) var(--cx-ease) both;
}
.kpis li:nth-child(2) { animation-delay: 40ms; }
.kpis li:nth-child(3) { animation-delay: 80ms; }
.kpis li:nth-child(4) { animation-delay: 120ms; }
.kpis b { display: block; font-size: 1.7rem; letter-spacing: -.02em; line-height: 1.15; font-variant-numeric: tabular-nums; color: var(--ink); }
.kpis b::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--teal); margin-right: 8px; vertical-align: .3em; }
.kpis span { color: var(--muted); font-size: .9rem; }
.p-hero .cta { margin-bottom: 12px; }

/* the price table, grouped */
.tablewrap { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--cx-shadow); overflow: hidden; margin-top: 18px; }
.ptable { width: 100%; border-collapse: collapse; font-size: .95rem; }
.ptable th, .ptable td { text-align: left; padding: 12px 18px; border-bottom: 1px solid var(--line); vertical-align: top; }
.ptable thead th { font-size: .75rem; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); font-weight: 650; background: var(--code-bg); }
.ptable tr.group th { background: color-mix(in srgb, var(--brand-soft) 60%, var(--panel)); color: var(--ink); padding-top: 14px; padding-bottom: 12px; }
.ptable tr.group th .p-ic { vertical-align: -3px; margin-right: 8px; }
.g-t { font-weight: 700; font-size: 1rem; }
.g-b { display: block; font-weight: 400; color: var(--muted); font-size: .85rem; margin: 2px 0 0 26px; }
.ptable tbody:last-child tr:last-child td { border-bottom: 0; }
.ptable td b { font-weight: 650; }
.num { text-align: right !important; font-variant-numeric: tabular-nums; }
.ptable td.num { white-space: nowrap; }
.ptable.limits td.num { white-space: normal; }
.sub { display: block; color: var(--muted); font-size: .82rem; font-weight: 400; }
.free { color: var(--ok); font-weight: 700; }
.note { color: var(--muted); font-size: .9rem; max-width: 760px; margin-top: 14px; }

/* worked examples: itemized receipts */
.exs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-top: 18px; }
.ex { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 22px; box-shadow: var(--cx-shadow); min-width: 0; position: relative; overflow: hidden; }
.ex::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 4px; background: var(--action); }
#ex-business::before { background: var(--teal); }
.ex h3 { font-size: 1.15rem; margin: 0 0 2px; }
.ex header p { margin: 0 0 8px; font-size: .92rem; }
.mini { width: 100%; border-collapse: collapse; font-size: .92rem; margin: 6px 0 10px; }
.mini td, .mini th { padding: 7px 0; border-bottom: 1px dashed var(--line); text-align: left; }
.mini th { color: var(--muted); font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; font-weight: 650; }
.mini td.muted { padding-right: 8px; }
.mini .num { padding-left: 10px; }
.total { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin: 6px 0 0; }
.total b { font-size: 1.6rem; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }

/* estimator */
.est {
  display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 0; margin-top: 18px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--cx-shadow); overflow: hidden;
}
.est-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; padding: 24px; }
.est-f { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.est-l { font-weight: 650; font-size: .92rem; }
.est-h { color: var(--muted); font-size: .8rem; }
.est-go { grid-column: 1 / -1; justify-self: start; border: 0; font: inherit; font-weight: 650; cursor: pointer; }
.est.is-live .est-go { display: none; }
.est-in {
  width: 100%; min-width: 0; font: inherit; font-size: 1.1rem; font-variant-numeric: tabular-nums; padding: 11px 13px; margin: 0;
  border-radius: 12px; border: 1.5px solid var(--line); background: var(--cx-field); color: var(--ink);
  transition: border-color var(--cx-fast) var(--cx-ease), box-shadow var(--cx-fast) var(--cx-ease);
}
.est-in:hover { border-color: color-mix(in srgb, var(--muted) 45%, var(--line)); }
.est-in:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--cx-ring); }
.est-out { padding: 24px; background: color-mix(in srgb, var(--brand-soft) 55%, var(--panel)); border-left: 1px solid var(--line); min-width: 0; }
.est-k { margin: 0; color: var(--muted); font-size: .78rem; text-transform: uppercase; letter-spacing: .07em; font-weight: 650; }
.est-total { margin: 2px 0 10px; font-size: clamp(2.2rem, 5vw, 3rem); font-weight: 750; letter-spacing: -.03em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.est-total output { display: inline-block; }
.est-total output.bump { animation: cx-pop var(--cx-mid) var(--cx-ease); }
.est-lines { margin: 0; display: grid; gap: 4px; }
.est-lines div { display: flex; justify-content: space-between; gap: 12px; font-size: .92rem; border-bottom: 1px dashed var(--line); padding: 4px 0; }
.est-lines dt { color: var(--muted); }
.est-lines dd { margin: 0; font-variant-numeric: tabular-nums; font-weight: 600; }
.est-note { color: var(--muted); font-size: .82rem; margin: 12px 0 0; }

/* how billing works */
.steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-top: 18px; }
.step { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 20px; min-width: 0; }
.step .p-ic { display: block; margin-bottom: 10px; padding: 8px; width: 38px; height: 38px; border-radius: 11px; background: var(--brand-soft); }
.step h3 { font-size: 1.02rem; }
.step p { margin: 6px 0 0; color: var(--muted); font-size: .93rem; }

/* FAQ */
.faq { display: grid; gap: 10px; margin-top: 18px; max-width: 840px; }
.faq details { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 0 18px; }
.faq summary { cursor: pointer; font-weight: 650; padding: 14px 0; list-style: none; display: flex; justify-content: space-between; gap: 12px; align-items: center; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: ""; flex: none; width: 8px; height: 8px; border-right: 2px solid var(--accent); border-bottom: 2px solid var(--accent); transform: translateY(-2px) rotate(45deg); transition: transform var(--cx-fast) var(--cx-ease); }
.faq details[open] summary::after { transform: translateY(1px) rotate(-135deg); }
.faq summary:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
.faq details p { color: var(--muted); margin: 0 0 14px; animation: cx-in var(--cx-mid) var(--cx-ease) both; }

/* closing call to action */
.p-cta {
  display: flex; justify-content: space-between; align-items: center; gap: 16px 24px; flex-wrap: wrap;
  padding: 28px; border-radius: 20px; border: 1px solid var(--line); box-shadow: var(--cx-shadow);
  background:
    radial-gradient(600px 260px at 0% 0%, color-mix(in srgb, var(--action) 20%, transparent), transparent 70%),
    var(--panel);
}
.p-cta h2 { margin: 0 0 4px; }
.p-cta p { margin: 0; color: var(--muted); }
.p-cta .cta { margin: 0; }
.pricing-page .foot { margin-top: 48px; }

@media (max-width: 900px) {
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .exs { grid-template-columns: 1fr; }
  .est { grid-template-columns: 1fr; }
  .est-out { border-left: 0; border-top: 1px solid var(--line); }
}
@media (max-width: 600px) {
  .p-hero { padding-top: 40px !important; }
  .pricing > section { padding-top: 44px; }
  .kpis { gap: 10px; }
  .kpis li { padding: 12px 14px; }
  .kpis b { font-size: 1.35rem; }
  .steps { grid-template-columns: 1fr; }
  .est-fields { grid-template-columns: 1fr; padding: 18px; gap: 14px; }
  .est-out { padding: 18px; }
  .ex { padding: 18px; }
  .p-cta { padding: 22px 18px; }
  .p-cta .cta .btn { flex: 1 1 auto; text-align: center; }
  /* the price table stays two columns: the label wraps, the price stays to the right */
  .ptable th, .ptable td { padding: 10px 14px; }
  .ptable td.num { white-space: normal; min-width: 7.5em; }
  .g-b { margin-left: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .p-hero h1, .kpis li, .faq details p, .est-total output.bump { animation: none; }
  .est-in, .faq summary::after { transition: none; }
}
