:root {
  color-scheme: light;
  --paper: #f5f0e2;
  --sheet: #fcf8ed;
  --ink: #1c362b;
  --muted: #4d5547;
  --green: #2b5140;
  --line: #c9c4af;
  --line-dark: #9c9b85;
  --wash: #e9ebdd;
  --red: #833a2c;
  --serif: Georgia, "Times New Roman", serif;
  --text: "Segoe UI", Arial, sans-serif;
  --mono: "Courier New", monospace;
}
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { background: var(--paper); color: var(--ink); scroll-behavior: smooth; }
body { margin: 0; font: 1rem/1.5 var(--text); }
input, select, button, textarea { font: inherit; }
a { color: inherit; text-underline-offset: .22em; }
a:hover { color: #466443; }
:focus-visible { outline: 2px solid #536e48; outline-offset: 3px; }
.skip { position: fixed; top: 10px; left: 10px; z-index: 3; padding: 8px 14px; background: var(--sheet); transform: translateY(-160%); }
.skip:focus { transform: none; }
.wrap { width: min(1120px, calc(100% - 88px)); margin-inline: auto; }
.masthead { border-block: 4px solid var(--ink); border-bottom-width: 1px; }
.mast-inner { min-height: 69px; display: flex; align-items: center; gap: 20px; justify-content: space-between; }
.brand { display: inline-flex; align-items: center; gap: .01em; flex: none; text-decoration: none; font: 700 1.7rem/1 var(--serif); letter-spacing: -.06em; }
.brand > span:last-child { font-style: italic; font-weight: 400; }
.brand-mark { display: grid; align-content: center; justify-items: start; gap: 3px; width: 23px; height: 27px; padding: 4px 3px; margin-right: 10px; border: 1px solid currentColor; }
.brand-mark i { width: 100%; height: 1px; background: currentColor; }
.brand-mark i:first-child { width: 55%; }
.brand-mark i:last-child { width: 74%; }
.mast-inner nav { display: flex; align-items: baseline; gap: clamp(14px, 3vw, 39px); }
.mast-inner nav a { text-decoration: none; font-size: .88rem; font-weight: 650; }
.mast-inner nav a:hover, .mast-inner nav [aria-current] { text-decoration: underline; }
.mast-note { color: var(--muted); font: italic .94rem/1.25 var(--serif); text-align: right; }

.workspace { padding-block: clamp(28px, 4vw, 54px) 57px; scroll-margin-top: 10px; }
.folio-heading { display: flex; align-items: end; justify-content: space-between; gap: 20px; padding-bottom: 19px; margin-bottom: 26px; border-bottom: 4px double var(--ink); }
h1, h2, h3 { font-family: var(--serif); font-weight: 400; }
h1 { margin: 0 0 7px; font-size: clamp(2.5rem, 5vw, 4.65rem); line-height: 1.02; letter-spacing: -.062em; }
.folio-heading h1 { animation: settle 380ms ease-out both; }
.folio-heading p { margin: 0; color: var(--muted); font-size: .96rem; }
.folio-source { flex: 0 1 auto; white-space: nowrap; font-size: .87rem; margin-bottom: 2px; }
.folio-source span { display: inline-block; margin-left: .2em; }
.workgrid { display: grid; grid-template-columns: minmax(0, 2.45fr) minmax(245px, 1fr); align-items: start; gap: clamp(25px, 4vw, 55px); }
#f24-form { display: grid; gap: 18px; min-width: 0; }
.panel { min-width: 0; }
.panel + .panel { padding-top: 15px; border-top: 1px solid var(--line); }
.panel-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 11px; }
.panel-bar h2 { margin: 0; font-size: clamp(1.35rem, 2.5vw, 1.72rem); line-height: 1.17; letter-spacing: -.035em; }
.quiet { min-height: 36px; border: 0; color: var(--green); background: transparent; padding: 4px 6px; cursor: pointer; font-size: .87rem; font-weight: 650; text-decoration: underline; text-underline-offset: .22em; }
.quiet:hover { color: #426144; }
.danger, .remove-row { color: var(--red); }
.mode { display: flex; align-items: end; gap: 6px; min-width: 0; margin: 0; padding: 0; border: 0; border-bottom: 1px solid var(--line-dark); }
.mode-choice { position: relative; display: inline-flex; align-items: center; gap: 8px; min-height: 43px; margin-bottom: -1px; padding: 7px 12px; color: var(--muted); background: #eae5d8; border: 1px solid var(--line-dark); border-radius: 6px 6px 0 0; font-size: .89rem; font-weight: 650; cursor: pointer; transition: background 160ms ease, color 160ms ease; }
.mode-choice:hover { background: var(--wash); }
.mode-choice:has(input:checked) { border-top: 3px solid var(--green); border-bottom-color: var(--sheet); padding-top: 5px; background: var(--sheet); color: var(--ink); }
.mode-choice input { flex: none; margin: 0; accent-color: var(--green); }
.local-caption { color: var(--muted); font-size: .83rem; margin-top: 8px; }
.fields { display: grid; gap: 11px 13px; }
.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.wide { grid-column: 1 / -1; }
.fields label { display: block; align-content: end; min-width: 0; font-size: .85rem; font-weight: 660; line-height: 1.3; }
.required { color: var(--red); }
.fields input:not([type='checkbox']), .fields select, .fields textarea { display: block; width: 100%; min-width: 0; min-height: 42px; margin-top: 5px; padding: 8px 10px; border: 1px solid var(--line-dark); border-radius: 2px; background: var(--sheet); color: var(--ink); font-size: 1rem; font-weight: 450; }
.fields textarea { min-height: 104px; resize: vertical; }
.fields input::placeholder { color: #616458; opacity: 1; }
.fields input[aria-invalid='true'] { border: 2px solid var(--red); }
.fields select { padding-right: 27px; appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--green) 50%), linear-gradient(135deg, var(--green) 50%, transparent 50%); background-repeat: no-repeat; background-size: 5px 5px; background-position: calc(100% - 15px) 50%, calc(100% - 10px) 50%; }
.extra { margin-top: 10px; }
summary { cursor: pointer; }
.extra summary { min-height: 32px; width: fit-content; color: var(--green); font-size: .88rem; font-weight: 650; padding-top: 4px; }
.extra[open] summary { margin-bottom: 7px; }
.counter { color: var(--muted); font: .85rem/1.3 var(--serif); font-style: italic; }
.panel-help { margin: -2px 0 12px; color: var(--muted); font-size: .88rem; }
.entry { min-width: 0; margin: 0 0 11px; padding: 9px 13px 6px; border: 1px solid var(--line); background: #efeadd; animation: settle 200ms ease-out both; }
.entry legend { padding-inline: 5px; font: 700 .76rem/1.2 var(--mono); letter-spacing: .05em; text-transform: uppercase; }
.entry-head { display: flex; justify-content: end; margin-block: -11px 1px; }
.check-group { display: flex; flex-wrap: wrap; gap: 8px 13px; }
.check-group label { display: inline-flex; align-items: center; gap: 4px; min-height: 32px; }
.check-group input { accent-color: var(--green); }
.form-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 10px; padding-top: 17px; border-top: 1px solid var(--line-dark); }
.button { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 8px 14px; border: 1px solid var(--green); border-radius: 1px; text-decoration: none; text-align: center; font-size: .9rem; font-weight: 650; line-height: 1.3; cursor: pointer; transition: background-color 160ms ease, transform 160ms ease; }
.button:active { transform: translateY(1px); }
.button:disabled { opacity: .58; cursor: default; transform: none; }
.primary { color: var(--sheet); background: var(--ink); outline-offset: 3px; box-shadow: inset 0 0 0 2px var(--ink), inset 0 0 0 3px #a0ae96; }
.primary:hover { color: var(--sheet); background: var(--green); }
.outline { color: var(--ink); background: transparent; }
.outline:hover { background: var(--wash); }
.output-note { color: var(--muted); margin: -7px 0 0; font-size: .83rem; }
.status { min-height: 1.35em; margin: -9px 0 0; color: var(--green); font-size: .88rem; }
.status[data-error='true'] { color: var(--red); font-weight: 700; }
.notice { padding: 9px 13px; border: 1px solid var(--line-dark); color: var(--muted); font-size: .9rem; }

.preview { position: sticky; top: 14px; min-width: 0; border: 1px solid var(--line-dark); border-top: 3px solid var(--ink); background: var(--sheet); padding: 15px 19px 17px; box-shadow: 3px 4px 0 #e1dcce; }
.preview-kicker { display: flex; justify-content: space-between; gap: 10px; padding-bottom: 8px; margin-bottom: 10px; border-bottom: 1px solid var(--line); color: var(--muted); font: 700 .71rem/1.2 var(--mono); letter-spacing: .09em; }
.preview h2 { margin: 0 0 3px; font-size: 1.15rem; }
.balance { display: block; font: 400 clamp(2.1rem, 3.9vw, 3.3rem)/1.12 var(--serif); font-variant-numeric: lining-nums tabular-nums; letter-spacing: -.057em; overflow-wrap: anywhere; }
.balance.bump { animation: total-entry 220ms ease-out both; }
.amounts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; padding-block: 10px; margin: 12px 0; border-block: 1px solid var(--line); }
.amounts dt { font-size: .81rem; color: var(--muted); }
.amounts dd { margin: 0; font-weight: 700; font-size: .92rem; overflow-wrap: anywhere; }
.document-preview { overflow-wrap: anywhere; padding: 10px 11px; border: 1px solid var(--line); background: #f1ecdf; }
.doc-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; border-bottom: 1px solid var(--line-dark); padding-bottom: 3px; }
.doc-head b { font: 400 1.65rem/1 var(--serif); letter-spacing: -.07em; }
.doc-head span, .doc-label, .doc-draft { font: 700 .69rem/1.2 var(--mono); letter-spacing: .045em; }
.doc-label { margin: 7px 0 2px; color: var(--muted); }
#doc-person { margin: 0 0 6px; font-size: .83rem; font-weight: 650; }
.doc-lines { display: grid; font: .75rem/1.3 var(--mono); }
.doc-lines > div { display: flex; justify-content: space-between; gap: 7px; padding: 4px 0; border-top: 1px solid var(--line); }
.doc-lines > div > :last-child { text-align: right; }
.doc-draft { margin: 6px 0 0; padding-top: 6px; border-top: 1px solid var(--line-dark); color: var(--red); }
.preview-note { color: var(--muted); font-size: .8rem; margin: 8px 0 0; }

.editorial-cover, .closing-band { color: #fff7e6; background: #203b30; border-block: 4px double #b0b296; }
.cover-grid { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); align-items: center; gap: clamp(30px, 6vw, 90px); padding-block: clamp(27px, 6vw, 77px); }
.cover-copy { padding-left: clamp(12px, 2vw, 27px); border-left: 1px solid #aeb799; }
.cover-copy h2, .closing-grid h2 { margin: 0; font-size: clamp(2.4rem, 5.3vw, 4.65rem); line-height: .98; letter-spacing: -.056em; }
.cover-copy p, .closing-grid p { margin: 14px 0 21px; max-width: 34em; color: #e6e5d3; }
.cover-photo { margin: 0; padding: 7px; border: 1px solid #9aab93; background: #354d3d; overflow: hidden; }
.cover-photo img { display: block; width: 100%; height: auto; aspect-ratio: 3 / 2; object-fit: cover; }
.cover-button { gap: 12px; color: var(--ink); background: #f3ead4; border-color: #e2d5b5; box-shadow: inset 0 0 0 2px #f3ead4, inset 0 0 0 3px #a5a589; }
.cover-button:hover { color: var(--ink); background: #fff9e9; }
.cover-button:focus-visible { outline-color: #fff7e6; }
.cover-button span { transition: transform 160ms ease; }
.cover-button:hover span { transform: translateY(2px); }
.chapter-nav { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: start; gap: 8px 25px; padding-block: 20px; }
.chapter-nav p { margin: 5px 0 0; font: italic 1.07rem/1.25 var(--serif); }
.chapter-nav ul { display: flex; flex-wrap: wrap; gap: 5px 8px; margin: 0; padding: 0; list-style: none; }
.chapter-nav a { display: block; padding: 5px 9px; color: var(--ink); border: 1px solid var(--line); font-size: .85rem; text-decoration: none; line-height: 1.35; }
.chapter-nav a:hover { background: var(--wash); text-decoration: underline; }
.guide { background: #ede8d9; border-block: 1px solid var(--line); }
.guide-inner, .guide-section, .faq { padding-block: clamp(33px, 6vw, 80px); scroll-margin-top: 12px; }
.guide-section + .guide-section, .faq { border-top: 1px solid var(--line); }
.guide-intro { max-width: 760px; margin-bottom: clamp(17px, 3vw, 33px); }
.guide-intro h2, .legal-content h2 { margin: 0; font-size: clamp(1.8rem, 3.3vw, 2.6rem); line-height: 1.1; letter-spacing: -.044em; }
.chapter-heading h2 { font-size: clamp(2rem, 4.15vw, 3.45rem); }
.chapter-heading h2::after { display: block; width: 27px; height: 3px; margin-block: 12px 10px; background: var(--green); content: ""; }
.guide-intro p, .guide-card p, .example-copy p, .faq p { margin: 7px 0 0; color: var(--muted); font-size: .95rem; }
.chapter-heading p { max-width: 68ch; font-size: 1rem; }
.guide-table { width: 100%; border-block: 1px solid var(--line-dark); border-collapse: collapse; table-layout: fixed; font-size: .91rem; }
.guide-table caption { padding-bottom: 7px; color: var(--muted); text-align: left; font-size: .84rem; }
.guide-table th, .guide-table td { border-bottom: 1px solid var(--line); padding: 11px 13px; text-align: left; vertical-align: top; overflow-wrap: anywhere; }
.guide-table thead th { background: var(--wash); }
.guide-table th:first-child { width: 28%; }
.error-table th:first-child { width: 34%; }
.guide-table td { background: #fcf8ed80; }
.guide-table tfoot { background: var(--wash); }
.guide-source { margin: 9px 0 0; color: var(--muted); font-size: .83rem; }
.guide-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(10px, 1.5vw, 20px); }
.guide-cards-two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.guide-card { min-width: 0; border: 1px solid var(--line); border-top: 3px double var(--green); padding: clamp(14px, 1.8vw, 24px); background: var(--sheet); }
.guide-icon { display: grid; place-items: center; width: 39px; height: 39px; border: 1px solid var(--line-dark); background: var(--wash); color: var(--green); font: 1.28rem/1 var(--serif); }
.guide-card h3, .example-copy h3, .faq-items h3 { margin: 10px 0 0; font-size: 1.35rem; line-height: 1.2; }
.model-cards { margin-bottom: 21px; }
.model-card { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 5px 13px; align-content: start; }
.model-card .guide-icon { grid-row: span 2; }
.model-card h3, .model-card p { margin-top: 0; }
.example-layout { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr); gap: clamp(16px, 4vw, 44px); align-items: center; padding: clamp(13px, 3vw, 31px); margin-top: 25px; background: #ede8d9; border-block: 1px solid var(--line); }
.example-figure { margin: 0; }
.example-figure img { display: block; width: 100%; height: auto; border: 1px solid var(--line); }
.example-figure figcaption { margin-top: 6px; color: var(--muted); font-size: .8rem; }
.example-copy ol { margin: 10px 0; padding-inline-start: 1.5em; }
.example-copy li + li { margin-top: 5px; }
.balance-guide { display: grid; grid-template-columns: minmax(0, .75fr) minmax(0, 1.25fr); gap: clamp(14px, 3vw, 31px); margin-top: 18px; }
.balance-example { display: grid; align-content: center; justify-items: start; min-height: 150px; padding: clamp(15px, 3vw, 29px); color: #fff7e6; background: var(--ink); border-block: 4px double #aeb799; }
.balance-example p { margin: 0; font: 1.07rem/1.2 var(--serif); }
.balance-example strong { font: 400 clamp(2.8rem, 6vw, 5.15rem)/1.07 var(--serif); letter-spacing: -.064em; }
.balance-example span { margin-top: 6px; font-size: .9rem; }
.balance-explanation { padding-block: 4px; }
.balance-explanation h3 { margin-top: 0; }
.balance-explanation h3:not(:first-child) { margin-top: 14px; }
.payment-checklist { margin-top: 20px; padding: clamp(12px, 2vw, 20px) clamp(13px, 3vw, 29px); background: var(--wash); border-left: 3px double var(--green); }
.payment-checklist h3 { margin-top: 0; }
.faq-items { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: clamp(20px, 6vw, 70px); }
.faq-items article { padding-block: 14px; border-top: 1px solid var(--line); }
.faq-items h3 { margin: 0; }
.faq-items p { margin-top: 6px; }
.closing-grid { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 15px 25px; padding-block: clamp(24px, 4.7vw, 57px); }
.closing-grid h2 { font-size: clamp(2rem, 4vw, 3.4rem); }
.closing-grid p { margin-bottom: 0; }
footer { border-top: 4px double var(--ink); }
.footer-inner { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px 22px; padding-block: 15px 21px; }
.footer-inner nav { display: flex; flex-wrap: wrap; gap: 8px 18px; }
.footer-inner nav a { font-size: .88rem; color: var(--muted); }
#print-sheet { display: none; }

.legal-page { padding-block: clamp(29px, 5.2vw, 62px); }
.legal-page .folio-heading { margin-bottom: 27px; }
.legal-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 3fr); gap: 25px 42px; }
.legal-index { display: grid; align-content: start; gap: 9px; font-size: .86rem; padding-block: 8px; border-top: 1px solid var(--line-dark); }
.legal-content { display: grid; gap: 26px; max-width: 730px; min-width: 0; }
.legal-content section { scroll-margin-top: 14px; border-top: 1px solid var(--line); padding-top: 11px; }
.legal-content h2 { font-size: 1.75rem; }
.legal-content p { margin-block: 8px 0; color: var(--muted); }
@supports (animation-timeline: view()) {
  .chapter-heading { animation: settle linear both; animation-timeline: view(); animation-range: entry 0% cover 23%; }
}
@keyframes settle { from { opacity: .5; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }
@keyframes total-entry { from { color: #54744b; transform: translateY(2px); } to { color: var(--ink); transform: none; } }
@media (max-width: 880px) {
  .wrap { width: calc(100% - 54px); }
  .workgrid { gap: 24px; }
  .payment-panel .cols-3 { grid-template-columns: repeat(2, minmax(0,1fr)); }
}
@media (max-width: 690px) {
  .wrap { width: calc(100% - 36px); }
  .mast-inner { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 9px 12px; padding-block: 11px; }
  .mast-inner nav { grid-column: 1 / -1; grid-row: 2; flex-wrap: wrap; gap: 8px 16px; }
  .mast-note { grid-column: 2; grid-row: 1; text-align: right; }
  .folio-heading { flex-wrap: wrap; gap: 6px; padding-bottom: 12px; margin-bottom: 17px; }
  .folio-heading h1 { letter-spacing: -.05em; }
  .folio-source { margin-top: 3px; }
  .workspace { padding-bottom: 35px; }
  .workgrid { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .preview { position: static; }
  .legal-layout, .example-layout, .guide-cards, .cover-grid, .chapter-nav, .balance-guide, .faq-items, .closing-grid { grid-template-columns: minmax(0, 1fr); }
  .cover-grid { gap: 19px; }
  .cover-copy p { margin-block: 8px 15px; }
  .example-layout, .guide-cards { gap: 14px; }
  .closing-grid .button { justify-self: start; }
  .guide-table { font-size: .83rem; }
  .guide-table th, .guide-table td { padding: 8px 6px; }
}
@media (max-width: 387px) {
  .wrap { width: calc(100% - 28px); }
  .brand { font-size: 1.46rem; }
  .mast-inner nav { gap: 12px; }
  .mast-inner nav a { font-size: .82rem; }
  .mode-choice { gap: 5px; padding-inline: 7px; font-size: .81rem; }
  .cols-2, .cols-3, .payment-panel .cols-3 { grid-template-columns: minmax(0, 1fr); }
  .form-actions .button { width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
@page { size: A4; margin: 13mm; }
@media print {
  :root { color-scheme: light; background: #fff; color: #111; }
  body:has(> #print-sheet) > :not(#print-sheet) { display: none !important; }
  #print-sheet { display: block; font: 10.5pt/1.45 Arial, sans-serif; }
  #print-sheet .print-warning { border: 2px solid #873240; padding: 7px 10px; font-weight: 700; text-transform: uppercase; color: #72253a; }
  #print-sheet h1 { margin: 10pt 0 4pt; font: 24pt/1.1 Georgia, serif; }
  #print-sheet h2 { margin: 13pt 0 6pt; font: 15pt/1.2 Georgia, serif; letter-spacing: normal; }
  #print-sheet p { margin: 3pt 0; overflow-wrap: anywhere; }
  #print-sheet table { width: 100%; border-collapse: collapse; table-layout: fixed; }
  #print-sheet thead { display: table-header-group; }
  #print-sheet tr { break-inside: avoid; }
  #print-sheet th, #print-sheet td { text-align: left; border: 1px solid #b7aab0; padding: 5pt; overflow-wrap: anywhere; vertical-align: top; }
  #print-sheet th:nth-child(1) { width: 51%; }
  #print-sheet th:nth-child(2), #print-sheet th:nth-child(3) { width: 24.5%; }
  #print-sheet .print-totals { break-inside: avoid; margin-top: 12pt; }
  #print-sheet .print-foot { margin-top: 14pt; font-size: 9pt; }
}
