/* Self-hosted Manrope (latin, latin-ext, vietnamese). No CDN. */
@font-face { font-family: Manrope; font-weight: 400; font-display: swap; src: url(/fonts/manrope-vietnamese-400-normal.woff2) format('woff2'); unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB; }
@font-face { font-family: Manrope; font-weight: 500; font-display: swap; src: url(/fonts/manrope-vietnamese-500-normal.woff2) format('woff2'); unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB; }
@font-face { font-family: Manrope; font-weight: 600; font-display: swap; src: url(/fonts/manrope-vietnamese-600-normal.woff2) format('woff2'); unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB; }
@font-face { font-family: Manrope; font-weight: 400; font-display: swap; src: url(/fonts/manrope-latin-ext-400-normal.woff2) format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: Manrope; font-weight: 500; font-display: swap; src: url(/fonts/manrope-latin-ext-500-normal.woff2) format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: Manrope; font-weight: 600; font-display: swap; src: url(/fonts/manrope-latin-ext-600-normal.woff2) format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: Manrope; font-weight: 400; font-display: swap; src: url(/fonts/manrope-latin-400-normal.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: Manrope; font-weight: 500; font-display: swap; src: url(/fonts/manrope-latin-500-normal.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: Manrope; font-weight: 600; font-display: swap; src: url(/fonts/manrope-latin-600-normal.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

:root {
  --bg: #F6F5F1; --surface: #FFFFFF; --surface-2: #EFEDE6; --line: #DAD7CE;
  --text: #16150F; --muted: #5C5A52; --accent: #0E6B4F; --accent-ink: #FFFFFF;
  --accent-soft: #DCEFE7; --warn-soft: #FFF1D6; --warn-ink: #6B4500; --err: #A3261B;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #131209; --surface: #1F1F1F; --surface-2: #272727; --line: #313131;
    --text: #F2F1EC; --muted: #A8A69E; --accent: #4CC79A; --accent-ink: #0B1F17;
    --accent-soft: #17352A; --warn-soft: #3A2E12; --warn-ink: #F3D08A; --err: #FF8A7D;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font-family: Manrope, system-ui, sans-serif; font-size: 16px; line-height: 24px; }
h1, h2, h3, h4 { text-wrap: balance; margin: 0; }
p, li { text-wrap: pretty; }
a { color: var(--accent); text-underline-offset: 3px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--surface); padding: 8px 12px; z-index: 10; }
.skip:focus { left: 8px; }

/* Text styles (B1) */
.heading-2 { font-size: 48px; line-height: 48px; font-weight: 600; }
.heading-3 { font-size: 36px; line-height: 40px; font-weight: 600; }
.heading-4 { font-size: 30px; line-height: 36px; font-weight: 600; }
.heading-5 { font-size: 24px; line-height: 32px; font-weight: 600; }
.heading-6 { font-size: 20px; line-height: 28px; font-weight: 600; }
.title-2 { font-size: 18px; line-height: 28px; font-weight: 500; }
.title-3 { font-size: 16px; line-height: 24px; font-weight: 500; }
.title-4 { font-size: 14px; line-height: 20px; font-weight: 500; }
.body-1 { font-size: 16px; line-height: 24px; font-weight: 600; }
.body-3 { font-size: 16px; line-height: 24px; font-weight: 400; }
.body-6 { font-size: 14px; line-height: 20px; font-weight: 400; }
.caption-2 { font-size: 14px; line-height: 20px; font-weight: 400; color: var(--muted); }
.caption-4 { font-size: 12px; line-height: 16px; font-weight: 500; }
.muted { color: var(--muted); }
.hero-title { background: linear-gradient(90deg, #000000, #666666); -webkit-background-clip: text; background-clip: text; color: transparent; max-width: 680px; }
@media (prefers-color-scheme: dark) { .hero-title { background-image: linear-gradient(90deg, #FFFFFF, #9B9B9B); } }
.hero-sub { max-width: 680px; }
@media (max-width: 640px) { .heading-2 { font-size: 36px; line-height: 40px; } .heading-3 { font-size: 30px; line-height: 36px; } }

/* Layout */
.wrap { max-width: 960px; margin: 0 auto; padding: 0 16px; }
.narrow { max-width: 680px; margin: 0 auto; padding: 0 16px; }
main { padding: 96px 0 64px; }
section + section { margin-top: 64px; }
.stack > * + * { margin-top: 16px; }
.stack-sm > * + * { margin-top: 8px; }
.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.grid-2 { display: grid; gap: 16px; grid-template-columns: 1fr; }
@media (min-width: 720px) { .grid-2 { grid-template-columns: 1fr 1fr; } }

/* Floating nav (B7) */
.nav { position: fixed; top: 12px; left: 50%; transform: translateX(-50%); z-index: 5; display: flex; gap: 4px; align-items: center;
  padding: 4px; border: 1px solid var(--line); border-radius: 16px; background: color-mix(in srgb, var(--surface) 80%, transparent);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); max-width: calc(100% - 24px); overflow-x: auto; scrollbar-width: none; }
.nav a { display: block; padding: 8px 12px; border-radius: 12px; text-decoration: none; color: var(--text); white-space: nowrap; font-size: 14px; line-height: 20px; font-weight: 500;
  transition: background-color 300ms var(--ease); }
.nav a:hover { background: var(--surface-2); }
.nav a[aria-current="page"] { background: var(--accent-soft); color: var(--accent); }
.nav .brand { font-weight: 600; }

/* Cards, buttons, forms */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 24px; }
.card-sm { padding: 16px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 8px 12px; border-radius: 12px; border: 1px solid transparent;
  background: var(--accent); color: var(--accent-ink); font: inherit; font-size: 16px; line-height: 24px; font-weight: 600; text-decoration: none; cursor: pointer;
  transition: transform 300ms var(--ease), opacity 300ms var(--ease), background-color 300ms var(--ease); min-height: 44px; }
.btn:hover { opacity: .92; transform: translateY(-1px); }
.btn:active { transform: translateY(1px) scale(0.98); }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--line); }
.btn-sm { font-size: 14px; line-height: 20px; min-height: 36px; }
.btn-block { width: 100%; }
label { display: block; font-size: 14px; line-height: 20px; font-weight: 500; margin-bottom: 4px; }
input, select, textarea { width: 100%; font: inherit; font-size: 16px; color: var(--text); background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 8px 12px; min-height: 44px; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: 0; border-color: var(--accent); }
.field + .field { margin-top: 16px; }
.hint { font-size: 12px; line-height: 16px; color: var(--muted); margin-top: 4px; }
.error { color: var(--err); font-size: 14px; line-height: 20px; }
.notice { background: var(--warn-soft); color: var(--warn-ink); border-radius: 12px; padding: 12px 16px; font-size: 14px; line-height: 20px; }
.ok { background: var(--accent-soft); color: var(--text); border-radius: 12px; padding: 12px 16px; font-size: 14px; line-height: 20px; }
.seg { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; background: var(--surface-2); border-radius: 12px; }
.seg input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.seg label { margin: 0; text-align: center; padding: 8px; border-radius: 8px; cursor: pointer; font-size: 16px; line-height: 24px; }
.seg input:checked + label { background: var(--surface); box-shadow: 0 1px 2px rgba(0,0,0,.08); }
.seg input:focus-visible + label { outline: 2px solid var(--accent); }

/* Numbers */
.num { font-variant-numeric: tabular-nums; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 8px; border-bottom: 1px solid var(--line); font-size: 14px; line-height: 20px; vertical-align: top; }
td.r, th.r { text-align: right; }
.result-big { font-size: 36px; line-height: 40px; font-weight: 600; }
.kv { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.kv:last-child { border-bottom: 0; }
.steps { counter-reset: s; list-style: none; padding: 0; margin: 0; }
.steps > li { counter-increment: s; position: relative; padding-left: 48px; }
.steps > li + li { margin-top: 24px; }
.steps > li::before { content: counter(s); position: absolute; left: 0; top: 0; width: 32px; height: 32px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; font-weight: 600; font-size: 14px; }
details { border: 1px solid var(--line); border-radius: 12px; padding: 12px 16px; background: var(--surface); }
details + details { margin-top: 8px; }
summary { cursor: pointer; font-weight: 500; }

/* Tagline reveal (B11) */
.reveal-words span { color: color-mix(in srgb, var(--text) 30%, transparent); transition: color 500ms var(--ease); }
.reveal-words span.on { color: var(--text); }
.rise { opacity: 0; transform: translateY(32px); transition: opacity 700ms var(--ease), transform 700ms var(--ease); }
.rise.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .rise { transform: none; transition: opacity 300ms linear; }
  .reveal-words span { color: var(--text); transition: none; }
  .btn:hover, .btn:active { transform: none; }
}

footer { border-top: 1px solid var(--line); padding: 32px 0 48px; margin-top: 64px; }
footer a { color: var(--muted); }

/* Ledger quick entry */
.amount-input { font-size: 24px; line-height: 32px; font-weight: 600; text-align: right; min-height: 56px; }
.entry { display: flex; justify-content: space-between; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.entry .amt-in { color: var(--accent); }
.pill { display: inline-block; padding: 2px 8px; border-radius: 999px; background: var(--surface-2); font-size: 12px; line-height: 16px; font-weight: 500; }

/* Printable declaration */
.print-only { display: none; }
@media print {
  @page { size: A4; margin: 15mm; }
  body { background: #fff; color: #000; font-size: 12px; line-height: 16px; }
  .nav, footer, .no-print, .skip { display: none !important; }
  .print-only { display: block; }
  main { padding: 0; }
  .card { border: 0; padding: 0; }
  .form-doc th, .form-doc td { border: 1px solid #000; color: #000; }
}
.form-doc { color: var(--text); }
.form-doc h1 { font-size: 18px; line-height: 28px; text-align: center; font-weight: 600; }
.form-doc .center { text-align: center; }
.form-doc th, .form-doc td { border: 1px solid var(--line); }
.check { display: flex; gap: 8px; align-items: flex-start; font-weight: 400; font-size: 14px; line-height: 20px; }
.check input { flex: none; width: 20px; min-height: 20px; height: 20px; margin: 0; }
