/* AppLedger guide pages: one topic per page, built to answer a search question fast. */
:root {
  --bg: #f2f4ef; --surface: #ffffff; --ink: #142019; --muted: #56645a; --line: #d6ddd4;
  --accent: #0e7a68; --accent-ink: #ffffff; --accent-soft: #dcefe9; --clay: #c9a27a; --sand: #e9e1cc;
  --bad: #b42318; --bad-soft: #fdeceb; --warn: #9a5b00; --warn-soft: #fdf3e1; --ok: #1e7a46; --ok-soft: #e3f3e9;
  --font-display: "Archivo", "Arial Narrow", system-ui, sans-serif;
  --font-body: "Source Sans 3", "Segoe UI", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, Consolas, monospace;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f1512; --surface: #161e19; --ink: #e5ece6; --muted: #9caaa0; --line: #29342d;
    --accent: #3cc2a6; --accent-ink: #062019; --accent-soft: #123129; --clay: #6b5038; --sand: #2b2a22;
    --bad: #ff8a80; --bad-soft: #3b1a17; --warn: #f2b95a; --warn-soft: #33280f; --ok: #6bd39a; --ok-soft: #12301f;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0f1512; --surface: #161e19; --ink: #e5ece6; --muted: #9caaa0; --line: #29342d;
  --accent: #3cc2a6; --accent-ink: #062019; --accent-soft: #123129; --clay: #6b5038; --sand: #2b2a22;
  --bad: #ff8a80; --bad-soft: #3b1a17; --warn: #f2b95a; --warn-soft: #33280f; --ok: #6bd39a; --ok-soft: #12301f;
  color-scheme: dark;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font-body); font-size: 18px; line-height: 1.6; overflow-x: hidden; }
a { color: var(--accent); text-underline-offset: 3px; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
h1, h2, h3 { font-family: var(--font-display); line-height: 1.1; margin: 0; text-wrap: balance; }
p { margin: 0; }
img, svg { max-width: 100%; }
code { font-family: var(--font-mono); font-size: 0.86em; background: var(--accent-soft); padding: 1px 6px; border-radius: 4px; overflow-wrap: anywhere; }
.ico { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }

nav.top { position: sticky; top: 0; z-index: 10; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
nav.top .in { max-width: 1100px; margin: 0 auto; padding: 12px 20px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); font-family: var(--font-display); font-weight: 800; font-stretch: 112%; font-size: 1.2rem; }
.brand svg { width: 26px; height: 26px; }
.navlinks { display: flex; align-items: center; gap: 18px; font-size: 0.95rem; }
.navlinks a:not(.btn) { color: var(--ink); text-decoration: none; white-space: nowrap; }
@media (max-width: 640px) { .navlinks a.hide-sm { display: none; } }
.btn { display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; font-family: var(--font-display); font-weight: 700; font-size: 1rem; padding: 13px 20px; border-radius: 6px; text-decoration: none; border: 2px solid var(--accent); }
.btn.primary { background: var(--accent); color: var(--accent-ink); }
.btn.ghost { color: var(--ink); border-color: var(--line); }
.btn.small { padding: 8px 14px; font-size: 0.9rem; }

.crumbs { max-width: 1100px; margin: 0 auto; padding: 18px 20px 0; font-size: 0.88rem; color: var(--muted); }
.crumbs a { color: var(--muted); }
header.g { max-width: 1100px; margin: 0 auto; padding: 28px 20px 40px; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr); gap: 40px; align-items: center; }
header.g h1 { font-size: clamp(2.1rem, 4.6vw, 3.4rem); font-weight: 800; font-stretch: 114%; letter-spacing: -0.02em; }
header.g .lede { font-size: 1.2rem; color: var(--muted); margin-top: 18px; max-width: 40ch; }
header.g .ctas { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 26px; }
header.g .art { width: 100%; height: auto; }
@media (max-width: 860px) { header.g { grid-template-columns: 1fr; padding-bottom: 24px; } }

.answer { max-width: 1100px; margin: 0 auto 8px; padding: 0 20px; }
.answer .box { background: var(--surface); border: 1px solid var(--line); border-left: 6px solid var(--accent); border-radius: 12px; padding: 20px 22px; display: flex; flex-direction: column; gap: 8px; }
.answer .box b.q { font-family: var(--font-display); font-size: 1.05rem; }

article { max-width: 760px; margin: 0 auto; padding: 32px 20px 64px; display: flex; flex-direction: column; gap: 22px; }
article h2 { font-size: clamp(1.6rem, 3.2vw, 2.1rem); font-weight: 800; font-stretch: 108%; margin-top: 26px; letter-spacing: -0.01em; }
article h3 { font-size: 1.2rem; font-weight: 700; margin-top: 6px; }
article ul, article ol { margin: 0; padding-left: 1.2em; display: flex; flex-direction: column; gap: 8px; }
article .muted, .note { color: var(--muted); font-size: 0.92rem; }
.wide { max-width: 1100px; margin: 8px auto; padding: 0 20px; }

/* Visual blocks */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 14px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 18px; display: flex; flex-direction: column; gap: 8px; }
.card .badge { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); }
.card.bad .badge { background: var(--bad-soft); color: var(--bad); }
.card.warn .badge { background: var(--warn-soft); color: var(--warn); }
.card h3 { font-size: 1.1rem; margin: 0; }
.card p { font-size: 0.97rem; color: var(--muted); line-height: 1.45; }
.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 18px; }
.stat b { display: block; font-family: var(--font-display); font-weight: 800; font-size: 2.2rem; line-height: 1; color: var(--bad); }
.stat span { display: block; margin-top: 8px; font-size: 0.95rem; color: var(--muted); line-height: 1.4; }
.stat a { font-size: 0.82rem; }
.compare { width: 100%; border-collapse: collapse; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; font-size: 0.95rem; }
.compare th, .compare td { text-align: left; padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
.compare th { font-family: var(--font-mono); font-size: 0.7rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); font-weight: 400; }
.compare td.y { color: var(--ok); font-weight: 700; }
.compare td.n { color: var(--muted); }
.scroll { overflow-x: auto; }
.steps { list-style: none; padding: 0 !important; counter-reset: s; display: flex; flex-direction: column; gap: 14px !important; }
.steps li { display: flex; gap: 14px; align-items: flex-start; }
.steps li::before { counter-increment: s; content: counter(s); width: 34px; height: 34px; flex: none; border-radius: 50%; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; font-family: var(--font-display); font-weight: 800; margin-top: 2px; }
.term { background: #142019; color: #e5ece6; border-radius: 12px; padding: 16px 18px; font-family: var(--font-mono); font-size: 0.86rem; line-height: 1.7; overflow-x: auto; }
.term .p { color: #3cc2a6; } .term .m { color: #9caaa0; } .term .r { color: #ff8a80; } .term .g { color: #6bd39a; } .term .y { color: #f2b95a; }
.finding { display: flex; gap: 12px; align-items: flex-start; background: var(--surface); border: 1px solid var(--line); border-left: 5px solid var(--warn); border-radius: 10px; padding: 14px 16px; }
.finding.blocker { border-left-color: var(--bad); }
.finding .tag { font-family: var(--font-mono); font-size: 0.7rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--warn); }
.finding.blocker .tag { color: var(--bad); }
.finding h4 { margin: 2px 0; font-family: var(--font-display); font-size: 1.02rem; }
.finding p { font-size: 0.93rem; color: var(--muted); }
.limits { background: var(--sand); border-radius: 12px; padding: 18px 20px; display: flex; flex-direction: column; gap: 8px; }
.limits b { font-family: var(--font-display); }
.cta-band { background: var(--accent); color: var(--accent-ink); border-radius: 14px; padding: 28px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 18px; margin-top: 20px; }
.cta-band h2 { margin: 0; font-size: 1.6rem; color: var(--accent-ink); }
.cta-band .btn { background: var(--accent-ink); color: var(--accent); border-color: var(--accent-ink); }
.faq details { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 0 18px; margin-bottom: 10px; }
.faq summary { cursor: pointer; padding: 14px 0; font-family: var(--font-display); font-weight: 700; list-style: none; display: flex; justify-content: space-between; gap: 12px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--accent); font-size: 1.3rem; line-height: 1; }
.faq details[open] summary::after { content: "–"; }
.faq details p { padding-bottom: 14px; color: var(--muted); }
.sources { font-size: 0.85rem; color: var(--muted); }
.sources ol { gap: 4px; }
.related { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.related a { display: block; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; text-decoration: none; color: var(--ink); font-weight: 600; }
.related a span { display: block; color: var(--muted); font-weight: 400; font-size: 0.9rem; }
footer { border-top: 1px solid var(--line); padding: 32px 20px 48px; font-size: 0.9rem; color: var(--muted); text-align: center; }
