/* The free invoice templates and their hub (pages/invoice-templates*.html, fragments/invoice-templates.html; mocks
   docs/mocks/site/invoice-maker/template.html, templates.html). Their sample sheets are images of the real PDF's first
   page (scripts/template-sheets.mjs), so these pages carry no paper CSS. */

/* Template library. The specimen is the contractor's exported invoice. */
.library-cover { background: var(--paper); border-bottom: 1px solid var(--line); }
.library-cover__inner { display: grid; grid-template-columns: 1fr minmax(0, .85fr); align-items: center; gap: clamp(32px, 6vw, 96px); padding-block: clamp(28px, 4vw, 64px); }
.library-intro h1 { font-family: var(--font-display); font-size: clamp(44px, 5.8vw, 86px); line-height: .99; letter-spacing: -.05em; }
.library-intro .lead { max-width: 35ch; margin-block-start: var(--space-5); }
.library-specimen { display: grid; grid-template-rows: minmax(0, 1fr) auto; overflow: hidden; height: clamp(225px, 23vw, 340px); border-radius: var(--r-xl); background: var(--cream-line); color: var(--ink); text-decoration: none; isolation: isolate; }
.library-specimen__sheet { position: relative; display: block; padding: var(--space-6) 14% 0; overflow: hidden; }
.library-specimen__sheet img { display: block; width: 100%; height: auto; transform: rotate(-4deg); transform-origin: 50% 15%; box-shadow: var(--shadow-pop); }
.library-specimen__caption { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); padding: var(--space-3) var(--space-5); background: var(--bg-panel); border: 1px solid var(--line); border-radius: 0 0 var(--r-xl) var(--r-xl); }
.library-specimen small, .library-files small { display: block; color: var(--text-muted); font-size: var(--fs-sm); }
.library-specimen strong { display: block; font-weight: 600; }
.library-body { padding-block-end: clamp(40px, 6vw, 88px); }
.library-formats { display: grid; grid-template-columns: minmax(0, .34fr) minmax(0, 1fr); align-items: center; column-gap: var(--space-6); row-gap: var(--space-3); padding-block: clamp(20px, 2.6vw, 40px); border-bottom: 1px solid var(--line); }
.library-formats h2 { max-width: 14ch; font-size: var(--fs-lg); line-height: 1.16; }
.library-files { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-3); }
.library-files a { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); border: 1px solid var(--line); border-radius: var(--r-md); padding: var(--space-3) var(--space-4); text-decoration: none; color: var(--ink); }
.library-files svg, .library-card > svg, .library-specimen svg { flex: none; color: var(--gold-deep); }
.library-files a:hover, .library-card:hover { background: var(--cream); border-color: var(--gold); }
.library-formats .caption { grid-column: 2; margin: 0; }
.library-directory { margin-block: clamp(36px, 5vw, 76px); }
.library-directory__head { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: var(--space-4); margin-bottom: var(--space-6); }
.library-directory h2 { font-family: var(--font-display); font-size: clamp(28px, 3.4vw, 50px); line-height: 1.1; letter-spacing: -.035em; }
.library-directory__head p { margin-top: var(--space-2); color: var(--text-muted); }
.library-directory label { display: block; font-size: var(--fs-sm); font-weight: 600; }
.library-directory input { width: 15em; max-width: 100%; color: var(--ink); font: inherit; background: var(--bg-panel); border: 1px solid var(--field-border); border-radius: var(--r-md); padding: var(--space-2) var(--space-3); margin-top: var(--space-1); }
.library-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-4); list-style: none; margin: 0; padding: 0; }
.library-card { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-content: start; height: 100%; overflow: hidden; border: 1px solid var(--line); border-radius: var(--r-xl); color: var(--ink); text-decoration: none; }
.library-card__paper { grid-column: 1 / -1; overflow: hidden; display: block; background: var(--cream-line); height: clamp(94px, 9vw, 144px); padding: var(--space-4) 12% 0; }
.library-grid li:nth-child(3n + 2) .library-card__paper { background: var(--sand-200); }
.library-grid li:nth-child(3n + 3) .library-card__paper { background: var(--cream); }
.library-card__paper img { display: block; width: 100%; height: auto; box-shadow: var(--shadow-pop); }
.library-card__body { display: grid; gap: var(--space-1); padding: var(--space-4) 0 var(--space-4) var(--space-4); }
.library-card__body strong { font-size: var(--fs-lg); letter-spacing: -.025em; }
.library-card__body span { color: var(--text-muted); font-size: var(--fs-sm); line-height: 1.45; }
.library-card > svg { align-self: start; margin: var(--space-5) var(--space-4) 0 var(--space-3); }
.library-search-status { color: var(--text-muted); }
.library-search-status:empty { display: none; }
@media (max-width: 860px) {
  .library-cover__inner { gap: var(--space-5); }
  .library-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .library-formats { grid-template-columns: minmax(0, 1fr); }
  .library-formats h2 { max-width: none; }
  .library-formats .caption { grid-column: 1; }
}
@media (max-width: 600px) {
  .library-cover__inner { display: block; }
  .library-intro .tp-cta .btn { padding-inline: var(--space-3); }
  .library-specimen { height: auto; margin-top: var(--space-5); grid-template-columns: 56px 1fr; grid-template-rows: auto; border: 1px solid var(--line); border-radius: var(--r-md); }
  .library-specimen__sheet { padding: var(--space-2) var(--space-2) 0; height: 100%; }
  .library-specimen__sheet img { position: absolute; width: 80%; }
  .library-specimen__caption { border: 0; border-radius: 0; padding: var(--space-2) var(--space-3); }
  .library-files { gap: var(--space-2); }
  .library-files a { display: grid; align-content: start; padding: var(--space-3) var(--space-2); }
  .library-files a svg { display: none; }
  .library-grid { grid-template-columns: minmax(0, 1fr); gap: var(--space-2); }
  .library-card { grid-template-columns: 64px 1fr auto; align-content: stretch; align-items: center; }
  .library-card__paper { grid-column: auto; align-self: stretch; height: auto; padding: var(--space-3) 0 0 var(--space-2); }
  .library-card__paper img { width: 150%; max-width: none; }
  .library-card > svg { align-self: center; margin-block: 0; }
  .library-card__body { padding: var(--space-3); }
  .library-directory__head [data-template-search], .library-directory input { width: 100%; }
}

/* ---------- the head: what it is, the way in, and the sheet ---------- */
.tp-head { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 40px; align-items: center; padding-block: clamp(40px, 6vw, 80px) clamp(32px, 4vw, 56px); }
.tp-head .kicker { margin-top: 14px; }
.tp-head h1 { margin-top: 12px; font-size: clamp(36px, 4.6vw, 62px); line-height: 1; letter-spacing: -.035em; }
.tp-head .lead { margin-top: 16px; max-width: 34em; }
.tp-cta { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 24px; }
.tp-blank { display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--space-2) var(--space-4); margin-block: var(--space-4) var(--space-2); }
.tp-blank a, .tp-jumps a { text-decoration: underline; }
.tp-jumps { margin: 0; }
.tp-cta .btn { gap: var(--icon-gap-sm); max-width: 100%; white-space: normal; }
.tp-docx-status { margin-top: 10px; max-width: 34em; }
.tp-docx-status:empty { display: none; }
.tp-head .tp-checked { margin-top: 14px; }
@media (max-width: 900px) {
  .tp-head { grid-template-columns: minmax(0, 1fr); }
  .tp-head .sheet-peek { --peek-h: 360px; }
}

/* ---------- the body: facts, the lines, the trade's own sections, wording, questions ---------- */
.tp-layout { display: grid; grid-template-columns: minmax(0, 1fr) 260px; gap: 56px; align-items: start; }
.tp-section { margin-top: 48px; }
.tp-section > h2 { font-size: var(--fs-xl); line-height: 1.2; letter-spacing: -.02em; }
.tp-section > h2 + * { margin-top: 18px; }
.tp-section.prose > h2 { margin-top: 0; }
.tp-toc { position: sticky; top: 90px; display: grid; gap: 4px; padding: 16px; border-radius: 14px; background: var(--paper); font-size: var(--fs-sm); }
.tp-toc b { margin-bottom: 4px; font-family: var(--font-sans); font-size: var(--fs-xs); font-weight: 500; letter-spacing: .1em; text-transform: uppercase; color: var(--gold-deep); }
.tp-toc a { padding: 3px 0; color: var(--text-muted); text-decoration: none; }
.tp-toc a:hover { color: var(--ink); }
@media (max-width: 900px) {
  .tp-layout { grid-template-columns: minmax(0, 1fr); }
  .tp-toc { display: none; }
}

.tp-facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 0; }
.tp-facts div { padding: 14px 16px; border-radius: 12px; background: var(--paper); }
.tp-facts dt { font-size: var(--fs-lg); font-weight: 700; letter-spacing: -.02em; color: var(--ink); }
.tp-facts dd { margin: 0; font-size: var(--fs-sm); color: var(--text-muted); }
@media (max-width: 640px) { .tp-facts { grid-template-columns: minmax(0, 1fr); } }

.tp-lines { width: 100%; border-collapse: collapse; font-size: var(--fs-body); }
.tp-lines th, .tp-lines td { padding: 12px 10px 12px 0; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.tp-lines thead th { font-size: var(--fs-sm); font-weight: 600; color: var(--caption); }
.tp-lines tbody th { width: 34%; font-weight: 600; color: var(--ink); }
.tp-lines td { color: var(--text-muted); }
.tp-lines a { color: var(--ink); font-weight: 600; text-decoration-color: var(--gold); text-underline-offset: 3px; }
.tp-lines--hub { max-width: 880px; }
.tp-section > p + .tp-lines { margin-top: 14px; }

/* Allow the invoice columns to scroll together on a narrow screen. */
.tp-sample-scroll { max-width: 100%; overflow-x: auto; margin-block: 18px 24px; }
.tp-sample caption { padding-bottom: 8px; text-align: left; font-weight: 600; color: var(--ink); }
.tp-sample { font-variant-numeric: tabular-nums; }
.tp-sample tbody th { width: auto; min-width: 8em; }
.tp-sample :is(th, td):nth-last-child(-n+3), .tp-sample tfoot :is(th, td) { text-align: right; white-space: nowrap; }
.tp-sample .tp-sample-total :is(th, td) { font-weight: 700; color: var(--ink); }


.tp-copy { position: relative; padding: 16px 18px; border: 1px solid var(--line); border-radius: 12px; background: var(--paper); }
.tp-copy + .tp-copy { margin-top: 10px; }
.tp-copy small { display: block; margin-bottom: 4px; font-size: var(--fs-xs); font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--caption); }
.tp-copy__text { font-family: var(--font-serif); font-size: var(--fs-md); line-height: 1.55; color: var(--ink); }
/* Shown only where the script can copy (invoice-templates.js adds .tp-can-copy); without it the text stays selectable. */
.tp-copy .copy-btn { display: none; position: absolute; top: 10px; right: 10px; }
.tp-can-copy .tp-copy { padding-right: 96px; }
.tp-can-copy .tp-copy .copy-btn { display: inline-flex; }

.tp-sources { margin-top: 48px; padding-top: 16px; border-top: 1px solid var(--line); font-size: var(--fs-sm); color: var(--caption); }
.tp-sources a { color: var(--text-muted); text-underline-offset: 3px; }
.tp-advice { margin-top: 8px; }

/* ---------- a trade's month in BillGrid: an example business, three numbers, then each step's words beside its real
   close-up (spotlight.css), sides alternating; no button, the close stays the one ask (docs/mocks/site/invoice-maker/
   trade-pages-spec.html) ---------- */
.tp-layout + .tp-month { margin-top: clamp(48px, 7vw, 88px); }
.tp-month { padding-block: clamp(56px, 8vw, 104px); background: var(--sand-50); border-block: 1px solid var(--line); }
.tp-month__head { max-width: 760px; }
.tp-month__head h2 { margin-top: 10px; font-family: var(--font-display); font-weight: var(--font-display-weight); font-size: var(--fs-d2); line-height: 1.04; text-wrap: balance; }
.tp-month__who { margin-top: 16px; max-width: 60ch; font-size: var(--fs-md); line-height: 1.55; color: var(--text-muted); }
.tp-month__stats { display: flex; flex-wrap: wrap; gap: 12px 44px; margin: 28px 0 0; }
.tp-month__stats dt { font-family: var(--font-display); font-size: clamp(32px, 3.4vw, 44px); line-height: 1; font-variant-numeric: tabular-nums; }
.tp-month__stats dd { margin: 6px 0 0; max-width: 20ch; font-size: var(--fs-sm); color: var(--caption); }
.tp-month__steps { display: grid; gap: clamp(48px, 7vw, 96px); margin: clamp(40px, 6vw, 72px) 0 0; padding: 0; list-style: none; }
/* side by side for a narrow screen (--flip puts the words on the right); a wide screen gets the full width under its
   words (--wide), so it is never shown below about 0.8x; a tall one runs off its stage (--rise) at --tall's height */
.tp-step { display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 8fr); gap: clamp(24px, 4vw, 64px); align-items: center; }
.tp-step--flip { grid-template-columns: minmax(0, 8fr) minmax(0, 4fr); }
.tp-step--flip .tp-step__text { order: 2; }
.tp-step--wide { grid-template-columns: minmax(0, 1fr); gap: clamp(20px, 2.4vw, 28px); }
.tp-step--wide .tp-step__text { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); column-gap: clamp(24px, 4vw, 64px); align-items: end; }
.tp-step--wide .tp-step__n, .tp-step--wide .tp-step__text h3 { grid-column: 1; }
.tp-step--wide .tp-step__text p { grid-column: 2; grid-row: 1 / span 2; margin-top: 0; }
.tp-step .tp-shot--tall { max-height: 620px; object-fit: cover; object-position: top; }
.tp-step__n { font-family: var(--font-mono); font-size: var(--fs-xs); letter-spacing: .1em; color: var(--gold-deep); }
.tp-step__text h3 { margin-top: 8px; font-family: var(--font-display); font-weight: var(--font-display-weight); font-size: clamp(24px, 2.4vw, 32px); line-height: 1.12; text-wrap: balance; }
.tp-step__text p { margin-top: 10px; max-width: 40ch; font-size: var(--fs-md); line-height: 1.6; color: var(--text-muted); }
.tp-step__text a { display: inline-block; margin-left: 4px; color: var(--ink); font-weight: 600; text-decoration-color: var(--gold); text-underline-offset: 3px; }
.tp-step .spotlight { min-width: 0; }
@media (max-width: 860px) {
  .tp-step, .tp-step--wide .tp-step__text { grid-template-columns: minmax(0, 1fr); }
  .tp-step--flip .tp-step__text { order: 0; }
  .tp-step--wide .tp-step__text p { grid-column: auto; grid-row: auto; margin-top: 10px; }
}
.tp-month + .tp-close { padding-top: clamp(48px, 6vw, 72px); }

/* ---------- the close: one sentence about BillGrid, then three more templates ---------- */
.tp-close { padding-bottom: 64px; }
.tp-next { max-width: 780px; }
.tp-next p { color: var(--text-muted); }
.tp-next a { color: var(--ink); font-weight: 600; text-decoration-color: var(--gold); text-underline-offset: 3px; }
.tp-more { padding-block: clamp(48px, 6vw, 72px); background: var(--paper); border-top: 1px solid var(--line); }
.tp-more .tp-cards { margin-top: 28px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 860px) { .tp-more .tp-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 520px) { .tp-more .tp-cards { grid-template-columns: minmax(0, 1fr); } }

/* Lawn care joins the completed and editable examples by billing cadence. */
.tp-head.lawn-workspace { display: block; padding: 0 0 clamp(36px, 5vw, 68px); background: var(--sand-50); border-bottom: 1px solid var(--line); }
.lawn-cover { position: relative; isolation: isolate; overflow: hidden; color: var(--on-accent); background: color-mix(in srgb, var(--site-accent) 43%, var(--ink)); }
.lawn-cover__inner { padding-block: clamp(28px, 3.8vw, 52px); }
.lawn-cover__copy { max-width: 54%; }
.lawn-cover__photo { position: absolute; z-index: -1; inset: 0 0 0 auto; width: 49%; height: 100%; object-fit: cover; object-position: 75% 54%; mask-image: linear-gradient(90deg, transparent, black 25%); }
.lawn-cover .back-link, .lawn-cover .tp-blank a { color: inherit; }
.lawn-cover .back-link { font-size: var(--fs-sm); }
.lawn-cover h1 { margin: var(--space-3) 0; color: var(--on-accent); font-size: clamp(38px, 4.5vw, 68px); letter-spacing: -.045em; text-wrap: balance; }
.lawn-cover h1 em { font-family: var(--font-serif); font-weight: 400; }
.lawn-cover__copy > p { max-width: 48ch; margin: 0; color: var(--sand-50); font-size: var(--fs-md); line-height: 1.45; }
.lawn-cover .tp-blank { margin: var(--space-4) 0 0; gap: var(--space-2) var(--space-4); font-size: var(--fs-sm); }
.lawn-cover .tp-blank b { font-weight: 600; }
.lawn-cover .tp-blank a { text-underline-offset: .25em; text-decoration-color: currentColor; }
.lawn-library__heading { display: flex; align-items: baseline; justify-content: space-between; gap: var(--space-3); margin: clamp(22px, 3vw, 40px) 0 var(--space-4); }
.lawn-library h2, .lawn-guide h2, .lawn-route h2 { font-family: var(--font-display); font-weight: 400; font-size: clamp(29px, 3vw, 44px); line-height: 1.13; }
.lawn-workspace [id], .lawn-guide [id], .lawn-route [id] { scroll-margin-block-start: 88px; }
.lawn-month-jump { display: none; }
.lawn-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(14px, 2vw, 28px); }
.lawn-paper { --lawn-edge: var(--site-accent); background: var(--bg-panel); border: 1px solid var(--border); border-top: 4px solid var(--lawn-edge); border-radius: var(--r-md); padding: clamp(14px, 2vw, 28px); display: flex; flex-direction: column; box-shadow: 0 4px 14px color-mix(in srgb, var(--sand-900) 5%, transparent); }
.lawn-paper + .lawn-paper { --lawn-edge: var(--gold-deep); }
.lawn-paper__meta { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 3px var(--space-3); margin: 0; font-size: var(--fs-xs); font-weight: 600; letter-spacing: .035em; color: var(--text-muted); }
.lawn-paper header h3 { margin: var(--space-2) 0 var(--space-1); font-size: clamp(23px, 2vw, 30px); }
.lawn-paper header > p:last-child { color: var(--text-muted); margin: 0; font-size: var(--fs-sm); }
.lawn-ledger { margin: var(--space-4) 0 var(--space-3); }
.lawn-ledger > div { display: flex; justify-content: space-between; gap: var(--space-2); padding: 5px 0; border-bottom: 1px solid var(--border-soft); font-size: var(--fs-sm); }
.lawn-ledger dt { color: var(--ink); }
.lawn-ledger dd { flex: none; margin: 0; font-variant-numeric: tabular-nums; }
.lawn-ledger small, .lawn-due small { color: var(--text-muted); font-size: var(--fs-xs); }
.lawn-ledger small { margin-left: var(--space-1); }
.lawn-due { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); background: var(--site-pick-bg); padding: 9px var(--space-3); margin-top: auto; border-radius: var(--r-sm); color: var(--ink); }
.lawn-paper + .lawn-paper .lawn-due { background: var(--sand-50); }
.lawn-due > span { font-size: var(--fs-sm); font-weight: 600; }
.lawn-due small { display: block; font-weight: 400; }
.lawn-due strong { font: 400 clamp(27px, 2.5vw, 36px)/1.1 var(--font-serif); font-variant-numeric: lining-nums tabular-nums; white-space: nowrap; }
.lawn-paper__actions { display: flex; align-items: center; flex-wrap: wrap; gap: var(--space-2) var(--space-4); margin-top: var(--space-4); }
.lawn-paper__actions > a[download] { display: inline-flex; align-items: center; gap: var(--icon-gap-sm); min-height: 36px; color: var(--site-accent); text-underline-offset: .2em; font-size: var(--fs-sm); font-weight: 600; }
.lawn-library__notes { display: flex; align-items: baseline; gap: var(--space-2) var(--space-5); flex-wrap: wrap; margin-top: var(--space-4); color: var(--text-muted); font-size: var(--fs-sm); }
.lawn-library__notes p { margin: 0; }
.lawn-text-button { border: 0; padding: 0; font: inherit; color: var(--site-accent); text-decoration: underline; text-underline-offset: .2em; background: transparent; cursor: pointer; }
.lawn-guide, .lawn-route__inner { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(26px, 5vw, 72px); align-items: start; padding-block: clamp(40px, 6vw, 80px); }
.lawn-guide__steps { margin: var(--space-4) 0 0; }
.lawn-guide__steps > div { padding: var(--space-3) 0; border-top: 1px solid var(--line); }
.lawn-guide__steps dt { font-weight: 650; color: var(--ink); }
.lawn-guide__steps dd { margin: 3px 0 0; color: var(--text-muted); }
.lawn-detail { min-width: 0; }
.lawn-detail h2 { margin-bottom: var(--space-4); }
.lawn-fold { border-top: 1px solid var(--line); }
.lawn-fold summary { cursor: pointer; padding: 13px 0; color: var(--ink); font-weight: 600; }
.lawn-fold > p { margin: 0 0 var(--space-3); color: var(--text-muted); }
.lawn-fold .tp-sample-scroll { margin: 0 0 var(--space-3); }
.lawn-original { display: inline-flex; align-items: center; gap: var(--space-3); font-size: var(--fs-sm); padding: 0 0 var(--space-4); }
.lawn-original img { width: 44px; height: auto; border: 1px solid var(--line); }
.lawn-fold .tp-copy { margin: 0 0 var(--space-3); }
.lawn-route { background: var(--site-pick-bg); border-block: 1px solid var(--line); }
.lawn-route__inner { grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); align-items: center; }
.lawn-route__inner p { max-width: 46ch; color: var(--text-muted); }
.lawn-route__inner figure { margin: 0; }
.lawn-route__inner figure img { display: block; width: 100%; height: auto; border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-card); }
.lawn-route + .tp-close { padding-top: var(--space-6); }
@media (max-width: 720px) {
  .lawn-cover__copy { max-width: 100%; }
  .lawn-cover__photo { width: 65%; opacity: .3; object-position: 75% center; mask-image: linear-gradient(90deg, transparent, black 90%); }
  .lawn-library__heading { display: block; }
  .lawn-month-jump { display: inline-block; margin-top: 4px; font-size: var(--fs-sm); }
  .lawn-pair, .lawn-guide, .lawn-route__inner { grid-template-columns: minmax(0, 1fr); }
  .lawn-paper__actions, .lawn-ledger { margin-top: var(--space-3); }
}

/* A trade's completed paper, its editable sample and its reusable forms. */
.tp-trade-head { gap: clamp(24px, 5vw, 80px); }
.tp-trade-head h1 { margin-top: var(--space-6); }
.tp-trade-options { margin-top: var(--space-6); border-block: 1px solid var(--line); }
.tp-trade-options > div { padding-block: var(--space-4); }
.tp-trade-options > div + div { border-top: 1px solid var(--line); }
.tp-trade-options .tp-blank { margin: 0; align-items: center; }
.tp-trade-options .tp-blank b, .tp-trade-label { color: var(--ink); font: 600 var(--fs-sm)/1.4 var(--font-sans); }
.tp-trade-options .tp-blank a, .tp-trade-jumps a, .word-library-guide a, .word-library-trades a { text-decoration: underline; text-underline-offset: .2em; }
.tp-trade-options .tp-blank a { padding-block: var(--space-2); font-size: var(--fs-sm); }
.tp-trade-edit .tp-cta { margin-top: var(--space-2); }
.tp-trade-jumps { display: flex; flex-wrap: wrap; gap: var(--space-1) var(--space-4); margin-top: var(--space-3); font-size: var(--fs-sm); }
.tp-trade-jumps a { padding-block: var(--space-2); }
.tp-trade-preview { min-width: 0; margin: 0; padding: var(--space-3); border: 1px solid var(--line); border-radius: var(--r-xl); background: var(--paper); }
.tp-trade-preview .sheet-peek { --peek-h: clamp(250px, 32vw, 420px); border-radius: var(--r-md); }
.tp-trade-preview figcaption { display: flex; justify-content: space-between; align-items: baseline; gap: var(--space-4); padding: var(--space-4) var(--space-2) var(--space-1); }
.tp-trade-preview figcaption span { display: grid; gap: var(--space-1); min-width: 0; overflow-wrap: anywhere; }
.tp-trade-preview figcaption span + span { text-align: right; font-variant-numeric: tabular-nums; }
.tp-trade-preview figcaption b { color: var(--ink); font-size: var(--fs-md); }
.tp-trade-preview figcaption small { color: var(--caption); font-size: var(--fs-sm); }

/* The Word library uses the numbers on the downloadable example. */
.word-library { padding-bottom: clamp(48px, 7vw, 88px); }
.word-library-head { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr); gap: clamp(24px, 7vw, 104px); align-items: center; padding-block: clamp(36px, 6vw, 80px); }
.word-library-intro h1 { max-width: 14ch; margin-block: var(--space-5) var(--space-4); font-size: clamp(40px, 5.4vw, 76px); letter-spacing: -.04em; line-height: 1; }
.word-library-intro .lead { max-width: 34em; }
.word-library-intro .btn { white-space: normal; }
.word-library-paper { min-width: 0; margin: 0; padding: clamp(18px, 3vw, 38px); border: 1px solid var(--line); border-top: var(--space-1) solid var(--gold-deep); border-radius: var(--r-sm); background: var(--bg-panel); box-shadow: var(--shadow-pop); font-size: var(--fs-sm); font-variant-numeric: tabular-nums; }
.word-library-paper figcaption, .word-library-parties, .word-library-ledger div { display: flex; justify-content: space-between; gap: var(--space-3); align-items: baseline; }
.word-library-paper figcaption { border-bottom: 1px solid var(--line); padding-bottom: var(--space-4); }
.word-library-paper figcaption strong { font: 500 clamp(23px, 2.8vw, 36px)/1.2 var(--font-display); letter-spacing: -.025em; }
.word-library-paper figcaption span, .word-library-parties dt { color: var(--caption); }
.word-library-parties { margin: var(--space-4) 0; }
.word-library-parties dd, .word-library-ledger dd { margin: 0; }
.word-library-parties > :last-child, .word-library-paper td, .word-library-paper thead th:not(:first-child) { text-align: right; }
.word-library-paper table { margin-block: var(--space-5) var(--space-3); width: 100%; border-collapse: collapse; font-size: inherit; }
.word-library-paper th, .word-library-paper td { padding: var(--space-2); border-bottom: 1px solid var(--line); }
.word-library-paper th { text-align: left; font-weight: 600; }
.word-library-paper thead th { background: var(--paper); }
.word-library-ledger { margin: 0; }
.word-library-ledger div { padding: var(--space-1) var(--space-2); }
.word-library-ledger dt { color: var(--text-muted); }
.word-library-ledger div:last-child { align-items: center; margin-top: var(--space-2); padding: var(--space-3); border-radius: var(--r-sm); background: var(--paper); font-weight: 700; }
.word-library-ledger div:last-child dd { font: 600 var(--fs-xl)/1 var(--font-sans); letter-spacing: -.035em; }
.word-library-guide, .word-library-trades { padding-block: clamp(30px, 5vw, 60px); border-top: 1px solid var(--line); }
.word-library-guide { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); gap: clamp(20px, 6vw, 96px); }
.word-library :is(.word-library-guide,.word-library-trades) h2 { margin: 0; font: var(--font-display-weight) clamp(30px, 3.6vw, 46px)/1.08 var(--font-display); letter-spacing: -.035em; }
.word-library-guide header p { margin-top: var(--space-4); max-width: 40ch; color: var(--text-muted); }
.word-library-steps { margin: 0; padding-left: 1.6em; }
.word-library-steps li { padding: 0 0 var(--space-4) var(--space-2); }
.word-library-steps li:last-child { padding-bottom: 0; }
.word-library-steps li::marker { font-family: var(--font-mono); color: var(--caption); font-size: var(--fs-sm); }
.word-library-steps strong { display: block; margin-bottom: var(--space-1); }
.word-library-trades ul { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: var(--space-6); margin: var(--space-6) 0 0; padding: 0; list-style: none; }
.word-library-trades li { padding-top: var(--space-3); border-top: 1px solid var(--line); }
.word-library-trades h3 { margin: 0; font-size: var(--fs-md); }
.word-library-trades p { margin: var(--space-2) 0; color: var(--text-muted); }
.word-library-trades li a { display: table; padding-block: var(--space-1); font-size: var(--fs-sm); }
.word-library-trades a[download] { font-weight: 700; }
@media (max-width: 760px) {
  .word-library-head, .word-library-guide { grid-template-columns: minmax(0,1fr); }
  .word-library-trades ul { grid-template-columns: repeat(2,minmax(0,1fr)); }
}
@media (max-width: 520px) {
  .word-library-trades ul { grid-template-columns: minmax(0,1fr); }
  .tp-trade-head { gap: var(--space-4); }
  .tp-trade-edit .btn { padding-inline: var(--space-3); }
  .tp-trade-options .tp-blank b { flex-basis: 100%; }
  .tp-trade-options .tp-blank { row-gap: 0; }
  .tp-trade-preview .sheet-peek { --peek-h: 220px; }
}
