/* ==========================================================================
   Public pages — landing (/), the /docs page's header and footer, and 404.
   Loaded after style.css, whose tokens, buttons and base it reuses. The guide
   itself is styled by docs.css (the app loads that one too, never this).
   ========================================================================== */
html, body { height: auto; }
.site { min-height: 100vh; display: flex; flex-direction: column; }
.wrap { width: 100%; max-width: 1080px; margin: 0 auto; padding: 0 var(--sp-6); }
@media (max-width: 600px) { .wrap { padding: 0 var(--sp-4); } }

/* header & footer */
.site-head {
  position: sticky; top: 0; z-index: 10;
  background: color-mix(in srgb, var(--page) 86%, transparent);
  backdrop-filter: saturate(1.4) blur(10px); -webkit-backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--hairline);
}
.site-head .wrap { display: flex; align-items: center; gap: var(--sp-3); height: 60px; }
.site-head .brand { padding: 0; margin-right: auto; color: var(--ink); text-decoration: none; }
.site-head nav { display: flex; align-items: center; gap: var(--sp-2); }
.site-head .link { color: var(--ink-2); text-decoration: none; font-weight: 500; padding: 6px 10px; border-radius: 8px; }
.site-head .link:hover { color: var(--ink); background: var(--surface-2); }
.theme-btn { width: 34px; height: 34px; padding: 0; justify-content: center; }
@media (max-width: 480px) { .site-head .hide-sm { display: none; } }

.site-foot { margin-top: auto; border-top: 1px solid var(--hairline); color: var(--ink-3); font-size: var(--fs-sm); }
.site-foot .wrap {
  display: grid; grid-template-columns: minmax(180px, 1.6fr) repeat(auto-fit, minmax(130px, 1fr));
  gap: var(--sp-6); padding-top: var(--sp-8); padding-bottom: var(--sp-8);
}
.site-foot b { display: block; color: var(--ink); font-weight: 650; margin-bottom: var(--sp-2); }
.site-foot .foot-brand span { display: block; max-width: 16em; }
.site-foot nav { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.site-foot a { color: var(--ink-2); text-decoration: none; }
.site-foot a:hover { color: var(--ink); }
@media (max-width: 600px) { .site-foot .wrap { grid-template-columns: 1fr 1fr; } .site-foot .foot-brand { grid-column: 1 / -1; } }

.btn.lg { padding: 11px 20px; font-size: var(--fs-lg); border-radius: 10px; }
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 11px; border-radius: 999px; font-size: var(--fs-sm); font-weight: 600;
  color: var(--accent-text); background: var(--accent-soft); border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent);
}

/* ---------- landing ---------- */
.hero { padding-top: 72px; padding-bottom: 56px; display: grid; grid-template-columns: 1.05fr 1fr; gap: 48px; align-items: center; }
.hero h1 { font-size: clamp(34px, 5vw, 52px); line-height: 1.06; letter-spacing: -0.03em; margin: var(--sp-4) 0; text-wrap: balance; }
.hero h1 em { font-style: normal; color: var(--accent-text); }
.hero .lede { font-size: 18px; color: var(--ink-2); max-width: 34em; margin: 0 0 var(--sp-6); text-wrap: pretty; }
.cta { display: flex; flex-wrap: wrap; gap: var(--sp-3); align-items: center; }
.cta-note { margin-top: var(--sp-3); font-size: var(--fs-sm); color: var(--ink-3); min-height: 1.5em; }
.cta-note code { user-select: all; }
@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; padding-top: 48px; padding-bottom: 40px; gap: 36px; }
}

/* a small, static picture of the budget screen */
.mock {
  background: var(--surface); border: 1px solid var(--hairline); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg); overflow: hidden; font-size: var(--fs-sm);
}
.mock-top { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); padding: var(--sp-4) var(--sp-5); border-bottom: 1px solid var(--hairline); }
.mock-period { font-weight: 650; font-size: var(--fs-md); }
.mock-period small { display: block; color: var(--ink-3); font-weight: 500; font-size: var(--fs-xs); }
.mock-rta { text-align: right; padding: 6px 12px; border-radius: 9px; background: var(--pos-bg); }
.mock-rta b { display: block; font-size: var(--fs-lg); color: var(--good-text); }
.mock-rta span { font-size: var(--fs-xs); color: var(--ink-2); }
.mock table { width: 100%; border-collapse: collapse; }
.mock th { text-align: right; font-weight: 600; color: var(--ink-3); font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: .04em; padding: 8px var(--sp-5); }
.mock th:first-child, .mock td:first-child { text-align: left; }
.mock td { padding: 8px var(--sp-5); border-top: 1px solid var(--hairline); text-align: right; white-space: nowrap; }
.mock tr.grp td { background: var(--surface-2); font-weight: 650; color: var(--ink-2); font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: .04em; padding-top: 6px; padding-bottom: 6px; }
.mock .av { display: inline-block; min-width: 64px; padding: 2px 8px; border-radius: 999px; font-weight: 600; text-align: right; }
.mock .av.pos { background: var(--pos-bg); color: var(--good-text); }
.mock .av.neg { background: var(--neg-bg); color: var(--bad); }
.mock .av.part { background: var(--part-bg); color: var(--warn); }
.mock .goal { display: block; font-size: var(--fs-xs); color: var(--ink-3); }

section.band { padding: 56px 0; border-top: 1px solid var(--hairline); }
.band h2 { font-size: clamp(24px, 3vw, 30px); letter-spacing: -0.02em; margin-bottom: var(--sp-2); text-wrap: balance; }
.band .sub { color: var(--ink-2); font-size: var(--fs-lg); margin: 0 0 var(--sp-8); max-width: 40em; }

.features { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--sp-4); }
@media (max-width: 860px) { .features { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .features { grid-template-columns: 1fr; } }
.feature { background: var(--surface); border: 1px solid var(--hairline); border-radius: var(--radius-lg); padding: var(--sp-5); }
.feature .ic { width: 36px; height: 36px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; background: var(--accent-soft); color: var(--accent-text); margin-bottom: var(--sp-3); }
.feature .ic svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.feature h3 { font-size: var(--fs-lg); margin-bottom: var(--sp-1); }
.feature.wide { grid-column: 1 / -1; }
.feature p { margin: 0; color: var(--ink-2); }
.feature p a { color: var(--accent-text); white-space: nowrap; }

.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--sp-6); counter-reset: step; }
@media (max-width: 760px) { .steps { grid-template-columns: 1fr; gap: var(--sp-5); } }
.step { counter-increment: step; }
.step::before {
  content: counter(step); display: inline-flex; width: 28px; height: 28px; border-radius: 50%;
  align-items: center; justify-content: center; font-weight: 700; font-size: var(--fs-sm);
  background: var(--accent); color: var(--on-accent); margin-bottom: var(--sp-3);
}
.step h3 { font-size: var(--fs-lg); margin-bottom: var(--sp-1); }
.step p { margin: 0; color: var(--ink-2); }

.beta {
  background: var(--surface); border: 1px solid var(--hairline); border-radius: var(--radius-lg);
  padding: var(--sp-8); display: grid; grid-template-columns: 1.4fr 1fr; gap: var(--sp-8); align-items: center;
}
.beta ul { margin: var(--sp-4) 0 0; padding-left: 1.2em; color: var(--ink-2); }
.beta li { margin: 4px 0; }
.beta .cta { justify-content: flex-end; }
@media (max-width: 760px) { .beta { grid-template-columns: 1fr; padding: var(--sp-6); gap: var(--sp-5); } .beta .cta { justify-content: flex-start; } }

/* ---------- 404 ---------- */
.lost { margin: auto; text-align: center; padding: 80px var(--sp-4); }
.lost h1 { font-size: 40px; margin-bottom: var(--sp-2); }
.lost p { color: var(--ink-2); margin: 0 0 var(--sp-6); }

/* ---------- pricing ---------- */
.pricing-head { padding-top: 64px; padding-bottom: var(--sp-8); text-align: center; }
.pricing-head h1 { font-size: clamp(30px, 4.4vw, 44px); line-height: 1.08; letter-spacing: -0.03em; margin: 0 auto var(--sp-4); max-width: 18em; text-wrap: balance; }
.pricing-head .lede { font-size: 18px; color: var(--ink-2); max-width: 36em; margin: 0 auto var(--sp-6); text-wrap: pretty; }
.billing-toggle { display: inline-flex; padding: 4px; gap: 4px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--hairline); }
.billing-toggle[hidden] { display: none; }
.billing-toggle button {
  border: 0; background: none; color: var(--ink-2); font: inherit; font-weight: 600;
  padding: 7px 16px; border-radius: 999px; cursor: pointer; display: inline-flex; gap: 8px; align-items: center;
}
.billing-toggle button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm, 0 1px 2px rgb(0 0 0 / .15)); }
.billing-toggle .save { font-size: var(--fs-xs); color: var(--good-text); }

.plans { display: grid; grid-template-columns: repeat(2, minmax(0, 420px)); justify-content: center; gap: var(--sp-6); padding-bottom: var(--sp-4); }
@media (max-width: 760px) { .plans { grid-template-columns: 1fr; } }
.plan {
  background: var(--surface); border: 1px solid var(--hairline); border-radius: var(--radius-lg);
  padding: var(--sp-6); display: flex; flex-direction: column;
}
.plan.plus { border-color: color-mix(in srgb, var(--accent) 55%, transparent); box-shadow: var(--shadow-lg); }
.plan h2 { font-size: 22px; letter-spacing: -0.02em; margin: 0; }
.plan.plus h2 { color: var(--accent-text); }
.plan-for { color: var(--ink-3); margin: 2px 0 var(--sp-5); }
.price { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.price b { font-size: 40px; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.price span { color: var(--ink-3); }
.price-alt { color: var(--ink-3); font-size: var(--fs-sm); margin: 2px 0 0; }
.plans.switchable[data-period="monthly"] [data-show="yearly"],
.plans.switchable[data-period="yearly"] [data-show="monthly"] { display: none; }
.plans:not(.switchable) .price[data-show="yearly"] { display: none; } /* no script: the monthly price plus the yearly line */
.plan .cta { margin: var(--sp-5) 0; }
.plan .cta .btn { width: 100%; justify-content: center; }
.plan-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; color: var(--ink-2); }
.plan-list li { position: relative; padding-left: 26px; }
.plan-list li::before {
  content: ""; position: absolute; left: 2px; top: .45em; width: 12px; height: 7px;
  border-left: 2px solid var(--good-text); border-bottom: 2px solid var(--good-text); transform: rotate(-45deg);
}
.plan-list b { color: var(--ink); font-weight: 650; }
.plan-list .lead-in { padding-left: 0; font-weight: 600; color: var(--ink); }
.plan-list .lead-in::before { content: none; }
.pricing-note { text-align: center; }

.faq { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--sp-6) var(--sp-8); }
@media (max-width: 760px) { .faq { grid-template-columns: 1fr; } }
.faq h3 { font-size: var(--fs-lg); margin-bottom: var(--sp-1); }
.faq p { margin: 0; color: var(--ink-2); }

/* ---------- legal pages (terms, privacy, refunds) ---------- */
.legal { max-width: 760px; padding-top: 48px; padding-bottom: 64px; }
.legal h1 { font-size: clamp(28px, 4vw, 38px); letter-spacing: -0.02em; margin-bottom: var(--sp-1); }
.legal .updated { color: var(--ink-3); margin: 0 0 var(--sp-6); }
.legal h2 { font-size: var(--fs-lg); margin: var(--sp-8) 0 var(--sp-2); }
.legal p, .legal li { color: var(--ink-2); line-height: 1.6; }
.legal ul { padding-left: 1.2em; }
.legal li { margin: 6px 0; }
.legal b { color: var(--ink); }
.legal a { color: var(--accent-text); }
mark.placeholder { background: var(--part-bg); color: var(--warn); border-radius: 4px; padding: 0 4px; font-weight: 600; }
.draft-notice { border: 1px dashed var(--warn); border-radius: var(--radius-lg); padding: var(--sp-3) var(--sp-4); color: var(--ink-2); }

/* ---------- topic and comparison pages (pages/article.html) ---------- */
.article { max-width: 800px; padding-top: 40px; padding-bottom: 56px; font-size: 16px; line-height: 1.65; }
.article .crumbs { color: var(--ink-3); font-size: var(--fs-sm); margin: 0 0 var(--sp-3); }
.article .crumbs a { color: var(--ink-2); }
.article h1 { font-size: clamp(30px, 4.6vw, 44px); line-height: 1.08; letter-spacing: -0.03em; margin-bottom: var(--sp-4); text-wrap: balance; }
.article .lede { font-size: 19px; color: var(--ink-2); margin: 0 0 var(--sp-6); text-wrap: pretty; }
.article h2 { font-size: clamp(22px, 2.8vw, 27px); letter-spacing: -0.02em; margin: var(--sp-8) 0 var(--sp-3); text-wrap: balance; }
.article h3 { font-size: 18px; margin: var(--sp-6) 0 var(--sp-2); }
.article p, .article ul, .article ol { margin: 0 0 var(--sp-4); color: var(--ink-2); }
.article li { margin: 5px 0; }
.article b, .article strong { color: var(--ink); }
.article a { color: var(--accent-text); }
.article .updated { color: var(--ink-3); font-size: var(--fs-sm); margin-top: calc(-1 * var(--sp-3)); }
.article .note { background: var(--surface); border: 1px solid var(--hairline); border-left: 3px solid var(--accent); border-radius: 0 var(--radius) var(--radius) 0; padding: var(--sp-3) var(--sp-4); }
.article .note > :last-child { margin-bottom: 0; }
.article .pick { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-4); margin: 0 0 var(--sp-4); }
.article .pick.solo { grid-template-columns: 1fr; }
.article .pick.solo > div { border-left: 3px solid var(--accent); }
@media (max-width: 640px) { .article .pick { grid-template-columns: 1fr; } }
.article .pick > div { background: var(--surface); border: 1px solid var(--hairline); border-radius: var(--radius-lg); padding: var(--sp-4) var(--sp-5); }
.article .pick h3 { margin-top: 0; }
.article .pick ul { margin: 0; padding-left: 1.2em; }
.table-scroll { overflow-x: auto; margin: 0 0 var(--sp-4); border: 1px solid var(--hairline); border-radius: var(--radius-lg); background: var(--surface); }
.compare { width: 100%; border-collapse: collapse; font-size: 14px; line-height: 1.45; }
.compare th, .compare td { text-align: left; vertical-align: top; padding: 10px 14px; border-top: 1px solid var(--hairline); }
.compare thead th { border-top: 0; background: var(--surface-2); color: var(--ink); font-weight: 650; white-space: nowrap; }
.compare tbody th { color: var(--ink); font-weight: 600; white-space: nowrap; }
.compare td { color: var(--ink-2); }
.compare th, .compare td { overflow-wrap: anywhere; }
.compare tbody th { overflow-wrap: normal; }
@media (max-width: 600px) { .compare th, .compare td { padding: 8px 10px; } .compare tbody th { white-space: normal; min-width: 84px; } }
/* the many-app table on /compare gets the page's full width */
.table-scroll.wide { width: min(1032px, calc(100vw - 48px)); position: relative; left: 50%; transform: translateX(-50%); }
.table-scroll.wide td { min-width: 120px; overflow-wrap: normal; }
@media (max-width: 600px) { .table-scroll.wide { width: calc(100vw - 32px); } }
.compare .us { background: var(--accent-soft); }
.article .toc { background: var(--surface); border: 1px solid var(--hairline); border-radius: var(--radius-lg); padding: var(--sp-4) var(--sp-5); margin: 0 0 var(--sp-6); font-size: 15px; }
.article .toc > b { display: block; margin-bottom: var(--sp-2); }
.article .toc ol { margin: 0; padding-left: 1.4em; columns: 2; column-gap: var(--sp-6); }
.article .toc li { margin: 0; padding: 2px 0; break-inside: avoid; }
@media (max-width: 600px) { .article .toc ol { columns: 1; } }
.article h2[id] { scroll-margin-top: 80px; }
.article .sources { font-size: var(--fs-sm); color: var(--ink-3); }
.article .sources li { margin: 2px 0; overflow-wrap: anywhere; }
.article .disclaimer { font-size: var(--fs-sm); color: var(--ink-3); }
.compare-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--sp-3); margin: 0 0 var(--sp-4); padding: 0; list-style: none; }
@media (max-width: 600px) { .compare-list { grid-template-columns: 1fr; } }
.compare-list a { display: block; padding: var(--sp-4); border: 1px solid var(--hairline); border-radius: var(--radius-lg); background: var(--surface); text-decoration: none; color: var(--ink-2); font-size: 14px; }
.compare-list a:hover { border-color: color-mix(in srgb, var(--accent) 55%, transparent); }
.compare-list b { display: block; color: var(--ink); font-size: 16px; }
