/* Linewick: a reviewer's worksheet. Black type on white paper; blue is the reviewer's ink. */
@font-face { font-family: Inter; src: url('./fonts/Inter-latin.woff2') format('woff2'); font-display: swap; font-weight: 100 900; }
@font-face { font-family: Newsreader; src: url('./fonts/Newsreader-latin.woff2') format('woff2'); font-display: swap; font-weight: 400 650; }
@font-face { font-family: 'IBM Plex Mono'; src: url('./fonts/IBMPlexMono-Regular-latin.woff2') format('woff2'); font-display: swap; font-weight: 400; }
@font-face { font-family: 'IBM Plex Mono'; src: url('./fonts/IBMPlexMono-Medium-latin.woff2') format('woff2'); font-display: swap; font-weight: 500; }

:root {
  --ink: #15171b;
  --muted: #5a606a;
  --faint: #868c96;
  --rule: #e3e4e8;
  --rule-strong: #c9ccd3;
  --wash: #f5f5f2;
  --paper: #fff;
  --blue: #002dad;
  --blue-hover: #00228a;
  --blue-wash: #edf1fb;
  --serif: Newsreader, 'Iowan Old Style', Charter, Georgia, serif;
  --sans: Inter, -apple-system, 'Segoe UI', Arial, sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  --max: 1200px;
  --ease-out: cubic-bezier(.22, 1, .36, 1);
  --ink-draw: cubic-bezier(.55, .1, .35, 1);
  /* Reviewer marks, drawn as single pen strokes. */
  --mark-under: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none' stroke='%23002dad' stroke-width='1.7' stroke-linecap='round'%3E%3Cpath d='M7 3.6c4.5-1.6 9.6.8 9.9 5.6.3 4.4-3.3 7.4-7.2 7.2-4.2-.2-6.6-3.3-6.3-6.9.2-2.4 1.6-4.2 3.8-5.4'/%3E%3C/svg%3E");
  --mark-over: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none' stroke='%23002dad' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M10 3.2 17 16H3.3L10.4 3.9'/%3E%3C/svg%3E");
  --mark-missing: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none' stroke='%23002dad' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 4.3h12.2v11.6H3.8V5'/%3E%3C/svg%3E");
  --mark-context: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none' stroke='%23002dad' stroke-width='1.7' stroke-linecap='round'%3E%3Cpath d='M6.6 6.7c.4-2.4 2.3-3.4 4.1-3.2 2.2.2 3.4 1.9 3 3.8-.5 2.2-3.6 2.6-3.6 5.3'/%3E%3Cpath d='M10.1 16.3h.1'/%3E%3C/svg%3E");
  --mark-matched: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none' stroke='%23002dad' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 10.6c1.9 1.3 3.3 3 4.5 5 3-6 6.3-9.6 10-12'/%3E%3C/svg%3E");
  font-family: var(--sans);
  color: var(--ink);
  background: var(--paper);
  font-synthesis: none;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 24px; }
body { margin: 0; font-size: 16px; line-height: 1.6; -webkit-font-smoothing: antialiased; font-optical-sizing: auto; text-rendering: optimizeLegibility; }
h1, h2, h3, h4, p { margin: 0; }
h1, h2 { font-family: var(--serif); font-weight: 500; line-height: 1.04; letter-spacing: -.018em; font-variant-numeric: lining-nums; }
h3 { font-weight: 600; font-size: 15px; line-height: 1.4; letter-spacing: -.005em; }
p { color: var(--muted); }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: wait; opacity: .5; }
a, button, summary, input, textarea, select { outline-offset: 4px; -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 2px solid var(--blue); }
img, svg { display: block; }
svg { flex-shrink: 0; }
strong { font-weight: 600; }
[hidden] { display: none !important; }
.icon { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.container { width: min(var(--max), calc(100% - 64px)); margin-inline: auto; }
.muted { color: var(--faint); }
.right { text-align: right; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; }
.skip-link { position: absolute; top: -80px; left: 20px; padding: 10px 18px; background: var(--ink); color: #fff; z-index: 100; }
.skip-link:focus { top: 10px; }
.no-script { padding: 14px 20px; background: #fff4de; text-align: center; color: #6d4c12; font-size: 14px; }

/* Header and footer */
.site-header { border-bottom: 1px solid var(--rule); background: var(--paper); }
.header-inner { min-height: 68px; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.brand { display: inline-flex; align-items: center; gap: 9px; font-size: 22px; font-weight: 650; letter-spacing: -.045em; line-height: 1; color: var(--ink); }
.brand img { width: 28px; height: 28px; border-radius: 6px; }
.nav { display: flex; align-items: center; gap: 28px; font-size: 14px; }
.nav a:not(.button) { color: var(--muted); }
.nav a:not(.button):hover, .footer-links a:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 4px; }
.app-brand-wrap { display: flex; align-items: center; gap: 18px; }
.app-nav-label { font-size: 14px; color: var(--muted); padding-left: 18px; border-left: 1px solid var(--rule); }
.site-footer { border-top: 1px solid var(--rule); padding: 32px 0 40px; margin-top: 24px; }
.footer-inner { display: flex; justify-content: space-between; align-items: center; gap: 30px; }
.site-footer .brand { font-size: 19px; }
.site-footer .brand img { width: 22px; height: 22px; border-radius: 5px; }
.footer-links { display: flex; align-items: center; gap: 24px; color: var(--muted); font-size: 13px; }

/* Controls */
.button { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 44px; padding: 10px 20px; border: 1px solid var(--blue); border-radius: 6px; background: var(--blue); color: #fff; font-size: 15px; font-weight: 500; line-height: 1.3; letter-spacing: -.005em; white-space: nowrap; transition: background .16s, border-color .16s, color .16s; }
.button:hover { background: var(--blue-hover); border-color: var(--blue-hover); color: #fff; }
.button:active { transform: translateY(1px); }
.button.small { min-height: 36px; padding: 7px 14px; font-size: 14px; }
.button.secondary { background: var(--paper); border-color: var(--rule-strong); color: var(--ink); }
.button.secondary:hover { background: var(--wash); border-color: #aeb2bb; color: var(--ink); }
.button.light { background: #fff; border-color: #fff; color: var(--ink); }
.text-link { display: inline-flex; align-items: center; gap: 8px; font-size: 15px; font-weight: 500; color: var(--ink); text-decoration: underline; text-decoration-color: var(--rule-strong); text-decoration-thickness: 1px; text-underline-offset: 5px; transition: color .16s, text-decoration-color .16s; }
.text-link:hover { color: var(--blue); text-decoration-color: currentColor; }
.eyebrow, .section-label, .hero-label { font-size: 14px; color: var(--muted); letter-spacing: 0; }
.step-index { font-family: var(--mono); color: var(--faint); font-size: 13px; }
.subnote { font-size: 13px; margin-top: 14px; }

/* Reviewer marks */
.mark, .finding-dot { display: inline-block; width: 18px; height: 18px; flex-shrink: 0; background: var(--mark-under) center / contain no-repeat; }
.mark-over, .finding-dot.over { background-image: var(--mark-over); }
.mark-missing_invoice, .finding-dot.missing_invoice { background-image: var(--mark-missing); }
.mark-needs_context, .finding-dot.needs_context { background-image: var(--mark-context); }
.mark-matched, .finding-dot.matched { background-image: var(--mark-matched); }
.ink { position: absolute; overflow: visible; pointer-events: none; fill: none; stroke: var(--blue); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.ink path { vector-effect: non-scaling-stroke; }

/* Landing: headline */
.hero { padding-top: 76px; }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 420px); column-gap: 64px; align-items: end; }
.hero-label { grid-column: 1 / -1; margin-bottom: 22px; }
.hero h1 { grid-column: 1 / -1; font-size: clamp(50px, 6.6vw, 90px); letter-spacing: -.028em; line-height: .98; max-width: 16ch; }
.hero h1 span { display: block; }
.hero-side { grid-column: 2; grid-row: 3; margin-top: 40px; }
.hero-description { grid-column: 1; grid-row: 3; margin-top: 40px; max-width: 560px; font-size: 19px; line-height: 1.55; color: #3e434b; letter-spacing: -.008em; }
.hero-side .hero-description { margin: 0; }
.hero-actions { display: flex; align-items: center; gap: 12px; }
.hero-price { margin-top: 16px; font-size: 14px; color: var(--muted); }

/* Landing: the sample worksheet */
.sheet-wrap { display: grid; grid-template-columns: minmax(0, 1fr) 208px; column-gap: 32px; margin-top: 64px; }
.sheet { position: relative; background: var(--paper); border: 1px solid var(--rule-strong); border-radius: 4px; box-shadow: 0 1px 0 var(--rule), 0 30px 60px -40px #1b2a4d40; }
.sheet-head { display: flex; align-items: baseline; justify-content: space-between; gap: 20px; padding: 22px 28px 18px; }
.sheet-head h2 { font-size: 26px; letter-spacing: -.012em; }
.sheet-head p { font-size: 13px; color: var(--muted); }
.sheet-columns, .preview-row { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1.3fr) 108px 108px 150px; column-gap: 20px; align-items: center; padding-inline: 28px; }
.sheet-columns { padding-block: 10px; border-block: 1px solid var(--rule); font-size: 12.5px; color: var(--muted); background: #fafaf8; }
.sheet-columns > :nth-child(n+3) { text-align: right; }
.preview-row { position: relative; min-height: 66px; padding-block: 12px; border-bottom: 1px solid var(--rule); font-size: 15px; transition: background .16s; }
.preview-row:last-child { border-bottom: 0; }
.preview-row:hover, .preview-row[aria-expanded=true] { background: #f7f8fc; }
.preview-row:focus-visible { outline-offset: -2px; }
.preview-customer { min-width: 0; display: flex; flex-direction: column; font-weight: 500; overflow-wrap: anywhere; }
.preview-customer small { font-size: 13px; font-weight: 400; color: var(--muted); margin-top: 1px; }
.preview-finding { display: flex; align-items: center; gap: 10px; font-size: 14px; color: #3e434b; }
.preview-num, .preview-amount { text-align: right; font-family: var(--mono); font-size: 14px; font-variant-numeric: tabular-nums; }
.preview-num.muted, .preview-amount.muted { color: var(--faint); }
.preview-amount { position: relative; justify-self: end; display: flex; flex-direction: column; align-items: flex-end; }
.preview-amount .amount-number { font-weight: 500; }
.preview-amount .amount-direction { font-family: var(--sans); font-size: 12.5px; color: var(--muted); margin-top: 1px; }
.is-flagged .amount-number { color: var(--blue); }
.preview-amount .ink-circle { left: -22px; top: -13px; width: calc(100% + 50px); height: calc(100% + 26px); }
.ink-tick { position: static; width: 26px; height: 22px; margin-right: 2px; }
.margin-note { position: absolute; left: calc(100% + 30px); top: 2px; width: 200px; font-size: 13.5px; line-height: 1.45; color: var(--blue); }
.margin-note .ink-arrow { position: absolute; left: -40px; top: 7px; width: 34px; height: 22px; }
.amount-number, .amount-direction { display: block; }
.amount-direction { color: var(--muted); font-size: 13px; line-height: 1.4; }

/* Landing: worked example */
.worked { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 80px; align-items: start; padding-block: 128px 112px; }
.feature-copy { position: sticky; top: 40px; }
.feature-copy h2 { margin-top: 14px; font-size: clamp(38px, 4.2vw, 54px); }
.feature-copy p:not(.section-label) { margin-top: 22px; font-size: 17px; line-height: 1.6; max-width: 440px; }
.feature-copy .text-link { margin-top: 28px; }
.feature-copy .text-link::after { content: '→'; text-decoration: none; display: inline-block; transition: transform .16s; }
.feature-copy .text-link:hover::after { transform: translateX(3px); }
.seat-story { position: relative; padding: 30px 34px 32px; background: var(--paper); border: 1px solid var(--rule-strong); border-radius: 4px; box-shadow: 0 30px 60px -44px #1b2a4d40; font-size: 14px; }
.story-header { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 20px; padding-bottom: 18px; border-bottom: 1px solid var(--rule); font-size: 15px; }
.story-header span { color: var(--muted); font-size: 13px; }
.story-block { padding-block: 18px; border-bottom: 1px solid var(--rule); }
.story-block h3 { font-size: 13px; font-weight: 500; color: var(--muted); margin-bottom: 12px; }
.seat-change { display: grid; gap: 10px; }
.seat-phase { display: grid; grid-template-columns: 88px minmax(0, 1fr) auto; align-items: center; gap: 16px; }
.seat-dates, .story-line, .story-amount, .story-total { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.seat-dates { color: var(--muted); font-size: 13px; }
.seat-phase strong { font-weight: 500; font-size: 14px; font-family: var(--mono); }
.seat-phase-after strong { color: var(--blue); }
.seat-grid { display: grid; grid-template-columns: repeat(24, 9px); gap: 3px; }
.seat-grid i { width: 9px; height: 14px; border-radius: 1.5px; background: #bcc2cc; }
.seat-grid .seat-empty { background: transparent; box-shadow: inset 0 0 0 1px var(--rule); }
.seat-grid .seat-added { background: var(--blue); --seat-order: 0; }
.seat-grid .seat-added:nth-child(22) { --seat-order: 1; }
.seat-grid .seat-added:nth-child(23) { --seat-order: 2; }
.seat-grid .seat-added:nth-child(24) { --seat-order: 3; }
.story-line, .story-amount { display: flex; justify-content: space-between; gap: 16px; padding-block: 5px; font-size: 14px; }
.story-line > :first-child { color: var(--muted); }
.story-expected { margin-top: 14px; }
.story-amount > :first-child { font-family: var(--sans); color: var(--muted); }
.story-total { position: relative; display: flex; justify-content: space-between; align-items: baseline; margin-top: 12px; padding-top: 14px; border-top: 1px solid var(--ink); font-size: 14px; }
.story-total > span { font-family: var(--sans); font-weight: 500; }
.story-total strong { position: relative; font-size: 22px; font-weight: 500; color: var(--blue); padding-bottom: 3px; border-bottom: 3px double var(--blue); line-height: 1.2; }
.story-total .ink-circle { right: -18px; top: 1px; width: 132px; height: 54px; }

/* Landing: key to the marks */
.sheet-key { grid-column: 1; display: flex; flex-wrap: wrap; gap: 8px 24px; margin-top: 16px; font-size: 13px; color: var(--muted); }
.sheet-key span { display: inline-flex; align-items: center; gap: 7px; }
.sheet-key .mark { width: 15px; height: 15px; }

/* Landing: closing */
.closing { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 360px); gap: 64px; align-items: end; padding-block: 56px 96px; border-top: 2px solid var(--ink); }
.closing h2 { font-size: clamp(34px, 3.8vw, 48px); max-width: 21ch; }
.closing p { margin-top: 18px; font-size: 16px; max-width: 540px; }
.closing-action p { margin-top: 14px; font-size: 14px; }

/* Billing review app */
.app-body { background: var(--paper); }
.app-main { width: min(1040px, calc(100% - 64px)); margin: auto; padding: 56px 0 56px; }
.review-heading { display: flex; justify-content: space-between; gap: 24px; align-items: flex-end; }
.review-eyebrow { font-size: 14px; margin-bottom: 10px; }
.review-heading h1 { font-size: 48px; letter-spacing: -.022em; }
.review-heading h1 + p { font-size: 14px; margin-top: 10px; color: var(--muted); }
.review-heading h1:focus { outline: none; }
.export-button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid var(--rule-strong); border-radius: 6px; padding: 8px 13px; background: var(--paper); font-size: 14px; line-height: 1.4; color: var(--ink); transition: background .16s, border-color .16s; }
.export-button:hover { background: var(--wash); border-color: #aeb2bb; }
.export-button svg { width: 15px; height: 15px; }
.summary-card { display: grid; grid-template-columns: 1fr 1fr 1.25fr; margin-top: 32px; border-block: 1px solid var(--ink); }
.summary-metric { padding: 20px 24px 22px 0; }
.summary-metric + .summary-metric { padding-left: 24px; border-left: 1px solid var(--rule); }
.metric-label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.metric-value { display: block; font-family: var(--serif); font-size: 38px; line-height: 1.1; font-weight: 500; letter-spacing: -.015em; font-variant-numeric: lining-nums tabular-nums; }
.metric-note { display: block; margin-top: 6px; color: var(--muted); font-size: 13px; }
.review-panel { margin-top: 32px; background: var(--paper); border: 1px solid var(--rule-strong); border-radius: 4px; overflow: hidden; }
.list-toolbar { padding: 10px 16px; border-bottom: 1px solid var(--rule); background: #fafaf8; }
.filters { display: flex; gap: 6px; }
.filter { display: inline-flex; align-items: center; gap: 8px; padding: 7px 12px; border: 1px solid transparent; border-radius: 5px; background: transparent; color: var(--muted); font-size: 14px; }
.filter:hover { color: var(--ink); }
.filter.active { color: var(--ink); background: var(--paper); border-color: var(--rule-strong); }
.filter-count { font-family: var(--mono); font-size: 12.5px; color: var(--faint); }
.row-head, .review-row { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr) 150px 16px; gap: 20px; align-items: center; padding-inline: 24px; }
.row-head { min-height: 40px; color: var(--muted); font-size: 12.5px; border-bottom: 1px solid var(--rule); }
.review-row { width: 100%; min-height: 72px; border: 0; border-bottom: 1px solid var(--rule); background: var(--paper); text-align: left; transition: background .16s; }
.review-row:hover, .review-row[aria-expanded=true] { background: #f7f8fc; }
.review-row .chevron { transition: color .16s, transform .16s var(--ease-out); }
.review-row:hover .chevron { color: var(--blue); transform: translateX(2px); }
.review-row:focus-visible { outline-offset: -2px; }
.review-row:last-child { border-bottom: 0; }
.customer-cell { min-width: 0; }
.customer-name { display: block; font-size: 15px; font-weight: 500; overflow-wrap: anywhere; }
.customer-product { display: block; color: var(--muted); font-size: 13px; margin-top: 2px; overflow-wrap: anywhere; }
.finding { display: flex; align-items: center; gap: 10px; font-size: 14px; color: #3e434b; }
.row-amount { text-align: right; font-family: var(--mono); font-size: 14px; font-variant-numeric: tabular-nums; }
.row-amount .amount-number { font-weight: 500; }
.row-amount .amount-direction { font-family: var(--sans); font-size: 12.5px; }
.row-amount.under .amount-number { color: var(--blue); }
.row-amount.needs_context, .row-amount.matched { color: var(--faint); }
.chevron { color: #b3b8c1; }
.chevron svg { width: 14px; height: 14px; }
.review-footnote { display: flex; justify-content: space-between; gap: 20px; margin-top: 20px; color: var(--muted); font-size: 13px; }
.review-footnote a:hover { color: var(--blue); }
.empty-state { padding: 64px 20px; text-align: center; }
.empty-state h2 { font-size: 26px; color: var(--muted); }
.review-cta { display: flex; justify-content: space-between; align-items: center; gap: 28px; margin-top: 40px; padding-top: 28px; border-top: 2px solid var(--ink); }
.review-cta h2 { font-size: 30px; line-height: 1.15; }
.review-cta p { margin-top: 8px; font-size: 15px; max-width: 460px; }
.review-cta .button { flex-shrink: 0; }
.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); z-index: 40; background: var(--ink); color: #fff; padding: 10px 18px; border-radius: 6px; font-size: 14px; box-shadow: 0 10px 30px #0f172a30; max-width: calc(100vw - 30px); }

/* Finding detail */
.detail-dialog { width: min(620px, calc(100vw - 40px)); max-height: calc(100dvh - 64px); padding: 0; border: 1px solid var(--rule-strong); border-radius: 6px; box-shadow: 0 40px 100px -20px #0f172a40; color: var(--ink); background: var(--paper); }
.detail-dialog::backdrop { background: #15171b59; }
.detail-top { position: sticky; top: 0; z-index: 1; background: var(--paper); display: flex; align-items: center; justify-content: space-between; padding: 14px 28px; border-bottom: 1px solid var(--rule); color: var(--muted); font-size: 14px; }
.icon-button { display: inline-grid; place-items: center; border: 0; border-radius: 5px; width: 32px; height: 32px; background: transparent; color: var(--muted); }
.icon-button:hover { background: var(--wash); color: var(--ink); }
.detail-body { padding: 28px 32px 32px; }
.detail-body h2 { font-size: 34px; letter-spacing: -.018em; overflow-wrap: anywhere; }
.detail-subtitle { color: var(--muted); font-size: 14px; line-height: 1.7; margin-top: 10px; }
.detail-amounts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; padding: 20px 0 22px; margin-top: 24px; border-block: 1px solid var(--ink); }
.detail-amounts > div { min-width: 0; display: flex; flex-direction: column; justify-content: flex-end; }
.detail-amounts .metric-value { font-size: 30px; overflow-wrap: anywhere; }
.difference-value { color: var(--blue); }
.detail-section { margin-top: 28px; }
.detail-section h3 { font-size: 14px; margin-bottom: 10px; font-weight: 600; }
.detail-section p, .context-list { font-size: 14px; color: var(--muted); line-height: 1.7; }
.context-list { padding-left: 18px; margin: 0; }
.context-list li + li { margin-top: 8px; }
.detail-table { border-collapse: collapse; width: 100%; text-align: left; font-size: 14px; font-family: var(--mono); font-variant-numeric: tabular-nums; }
.detail-table th { font-family: var(--sans); color: var(--muted); font-weight: 400; font-size: 13px; }
.detail-table th, .detail-table td { padding: 10px 0; border-bottom: 1px solid var(--rule); }
.detail-table th:last-child, .detail-table td:last-child { text-align: right; }
.selling-rate { font-size: 14px; color: var(--muted); line-height: 1.7; margin-top: 18px; }
.source-details { border-top: 1px solid var(--rule); margin-top: 28px; padding-top: 18px; font-size: 14px; color: var(--muted); }
.source-details summary { cursor: pointer; color: var(--ink); font-weight: 500; }
.source-details summary:hover { color: var(--blue); }
.source-details > p { font-size: 13px; line-height: 2; margin-top: 15px; overflow-wrap: anywhere; }
.source-details .export-button { margin-top: 18px; }
.source-group { margin-top: 24px; }
.source-group h3 { font-size: 14px; letter-spacing: 0; line-height: 1.5; color: var(--ink); }
.source-group h3 > span { font-weight: 400; color: var(--muted); }
.source-group > .source-records > p { margin-top: 10px; font-size: 13px; }
.source-record { padding-block: 13px; border-bottom: 1px solid var(--rule); font-size: 13px; }
.source-record:focus { outline: none; background: var(--blue-wash); }
.source-record h4 { margin: 0 0 8px; font-family: var(--mono); font-size: 13px; font-weight: 500; color: var(--ink); overflow-wrap: anywhere; }
.source-record dl { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 20px; margin: 0; }
.source-period { grid-column: 1 / -1; }
.source-record dt { color: var(--muted); }
.source-record dd { margin: 0; color: var(--ink); overflow-wrap: anywhere; font-family: var(--mono); font-variant-numeric: tabular-nums; }
.source-more { margin-top: 12px; min-height: 36px; padding: 6px 12px; background: var(--paper); border: 1px solid var(--rule-strong); border-radius: 5px; color: var(--blue); font-size: 13px; }

/* Supporting pages */
.page-intro { padding: 72px 0 40px; max-width: 760px; }
.page-intro h1 { font-size: clamp(40px, 4.6vw, 60px); margin: 16px 0 18px; letter-spacing: -.022em; }
.page-intro > p { font-size: 18px; line-height: 1.6; }
.content-narrow { max-width: 820px; margin: 0 auto; width: calc(100% - 96px); padding-bottom: 88px; }
.prose h2 { font-size: 30px; margin: 48px 0 14px; letter-spacing: -.015em; }
.prose h3 { font-size: 17px; margin: 28px 0 10px; }
.prose p, .prose li { font-size: 16px; line-height: 1.8; color: var(--muted); }
.prose ul { padding-left: 20px; }
.prose li + li { margin-top: 6px; }
.prose p + p { margin-top: 14px; }
.prose strong { color: var(--ink); }
.prose a:not(.button) { color: var(--blue); text-decoration: underline; text-underline-offset: 4px; }
.prose code { display: inline-block; font-family: var(--mono); font-size: 13px; background: var(--wash); color: var(--ink); padding: 0 5px; border-radius: 3px; white-space: nowrap; }
.prose .format-table { width: 100%; border-collapse: collapse; margin-top: 16px; font-size: 14px; border-top: 1px solid var(--ink); }
.format-table th:first-child, .format-table td:first-child { width: 190px; }
.format-table td:first-child code + br { line-height: 2; }
.format-table th { text-align: left; padding: 11px 14px 11px 0; font-weight: 500; font-size: 13px; color: var(--muted); border-bottom: 1px solid var(--rule); }
.format-table td { padding: 13px 14px 13px 0; border-bottom: 1px solid var(--rule); color: var(--muted); vertical-align: top; line-height: 1.7; }
.prose .download-set { display: flex; flex-wrap: wrap; gap: 12px; margin: 24px 0; }
.download-set .button { text-decoration: none; }
.note-box { border-left: 2px solid var(--blue); padding: 4px 0 4px 20px; margin: 8px 0 28px; font-size: 15px; line-height: 1.7; color: #3e434b; }

.prose details { border-top: 1px solid var(--rule); margin-top: 14px; }
.prose details:last-of-type { border-bottom: 1px solid var(--rule); }
.prose summary { cursor: pointer; padding: 12px 0; font-size: 15px; font-weight: 500; color: var(--ink); }
.prose summary:hover { color: var(--blue); }
.prose details[open] > summary { padding-bottom: 4px; }
.prose details > p { margin: 14px 0; }

/* Import */
.import-page .page-intro { max-width: 680px; padding-top: 16px; padding-bottom: 24px; }
.import-page .page-intro h1 { font-size: 46px; }
.upload-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; margin: 28px 0; border-block: 1px solid var(--ink); }
.upload-card { padding: 24px 24px 26px; min-width: 0; position: relative; }
.upload-card + .upload-card { border-left: 1px solid var(--rule); }
.upload-card:first-child { padding-left: 0; }
.upload-card:last-child { padding-right: 0; }
.upload-card h2 { font-size: 24px; margin: 14px 0 8px; letter-spacing: -.012em; }
.upload-card p { font-size: 14px; min-height: 46px; line-height: 1.6; }
.file-control { display: flex; align-items: center; justify-content: space-between; gap: 8px; background: var(--paper); border: 1px dashed var(--rule-strong); padding: 10px 12px; border-radius: 5px; font-size: 14px; margin-top: 18px; cursor: pointer; min-height: 44px; overflow-wrap: anywhere; transition: border-color .16s, background .16s; }
.file-control:hover { border-color: var(--blue); background: #fafbfe; }
.file-control:focus-within { outline: 2px solid var(--blue); outline-offset: 3px; }
.file-control input { position: absolute; opacity: 0; width: 1px; height: 1px; overflow: hidden; }
.file-status { font-family: var(--mono); font-size: 12.5px; margin-top: 10px; overflow-wrap: anywhere; line-height: 1.6; color: var(--muted); }
.upload-actions { display: flex; justify-content: space-between; align-items: center; gap: 28px; }
.check-label { display: flex; align-items: flex-start; gap: 10px; font-size: 14px; max-width: 520px; color: #3e434b; line-height: 1.6; }
.check-label input { width: 17px; height: 17px; flex-shrink: 0; margin-top: 3px; accent-color: var(--blue); }
.error-box { background: #fff3f0; border-left: 2px solid #b8321a; color: #7c2412; font-size: 14px; line-height: 1.7; padding: 14px 18px; margin: 22px 0; overflow-wrap: anywhere; }
.import-help { margin-top: 32px; font-size: 14px; }
.import-help .text-link { font-size: 14px; }
.import-report-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 28px; color: var(--muted); font-size: 14px; }

/* Pricing */
.pilot-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 56px; align-items: start; margin: 8px 0 96px; }
.pilot-card { padding: 0; }
.statement { border-top: 2px solid var(--ink); }
.statement-line { display: flex; align-items: flex-end; gap: 14px; padding: 22px 0 20px; border-bottom: 1px solid var(--rule); }
.statement-line > span:first-child { font-size: 17px; font-weight: 600; max-width: 260px; }
.statement-line > span:first-child small { display: block; font-size: 14px; font-weight: 400; color: var(--muted); margin-top: 4px; line-height: 1.5; }
.statement-line .leader { flex: 1; border-bottom: 2px dotted var(--rule-strong); margin-bottom: 7px; min-width: 16px; }
.pilot-price, .renewal-price strong { font-family: var(--serif); font-size: 40px; font-weight: 500; letter-spacing: -.02em; line-height: 1; color: var(--ink); font-variant-numeric: lining-nums tabular-nums; }
.pilot-price span, .renewal-price { font-family: var(--sans); font-size: 14px; color: var(--muted); letter-spacing: 0; font-weight: 400; white-space: nowrap; }
.pilot-price span { margin-left: 6px; }
.renewal-price strong { margin-right: 3px; }
.pilot-card ul { list-style: none; padding: 0; margin: 26px 0 0; }
.pilot-card li { font-size: 15px; margin: 12px 0; display: flex; gap: 12px; align-items: flex-start; color: #3e434b; line-height: 1.55; }
.pilot-card li .mark { margin-top: 2px; }
.pilot-card .pilot-fine { font-size: 14px; border-top: 1px solid var(--rule); padding-top: 18px; margin-top: 22px; }
.pilot-contact { padding: 32px 34px 30px; border: 1px solid var(--rule-strong); border-radius: 4px; background: var(--paper); box-shadow: 0 30px 60px -44px #1b2a4d40; }
.pilot-contact h2 { font-size: 34px; line-height: 1.1; }
.pilot-contact > p { font-size: 16px; line-height: 1.65; margin-top: 14px; max-width: 420px; }
.pilot-contact .button { margin-top: 26px; }
.contact-address { display: flex; align-items: center; gap: 8px; margin-top: 20px; color: var(--muted); font-size: 14px; font-family: var(--mono); }
.contact-address > a:hover { color: var(--blue); }
.contact-address .icon-button { width: 30px; height: 30px; }
.pilot-contact .contact-status { font-size: 13px; min-height: 21px; margin: 6px 0 0; line-height: 1.6; }
.service-workflow { max-width: 760px; margin: 0 0 96px; }
.service-workflow > h2 { margin-top: 0; }
.setup-steps { list-style: none; padding: 0; margin: 28px 0 0; counter-reset: step; border-top: 1px solid var(--ink); }
.setup-steps li { counter-increment: step; display: grid; grid-template-columns: 56px minmax(0, 1fr); padding: 20px 0; border-bottom: 1px solid var(--rule); margin: 0; }
.setup-steps li::before { content: counter(step, decimal-leading-zero); font-family: var(--mono); font-size: 13px; color: var(--faint); padding-top: 3px; }
.setup-steps li > * { grid-column: 2; }
.setup-steps h3 { margin: 0 0 6px; color: var(--ink); font-family: var(--sans); font-size: 17px; }
.setup-steps p { margin: 0; }
.service-timing { margin-top: 20px; }
.checkout-page { max-width: 700px; }
.checkout-card { padding: 28px 30px; border: 1px solid var(--rule-strong); border-radius: 4px; }
.checkout-card h2 { font-size: 26px; }
.checkout-card .pilot-price { margin: 14px 0 10px; }
.checkout-card .button { margin-top: 22px; }
.checkout-card [role=status] { min-height: 24px; }
.checkout-card .pilot-price { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px; }
.checkout-card .pilot-price span { margin-left: 0; }

/* Motion: the worksheet is marked once, like a reviewer going down the page. */
@supports (transition-behavior: allow-discrete) {
  .detail-dialog { opacity: 0; transform: translateY(10px); transition: opacity .18s ease-out, transform .22s var(--ease-out), display .22s allow-discrete, overlay .22s allow-discrete; }
  .detail-dialog[open] { opacity: 1; transform: translateY(0); }
  .detail-dialog::backdrop { opacity: 0; transition: opacity .18s ease-out, display .22s allow-discrete, overlay .22s allow-discrete; }
  .detail-dialog[open]::backdrop { opacity: 1; }
  @starting-style {
    .detail-dialog[open] { opacity: 0; transform: translateY(10px); }
    .detail-dialog[open]::backdrop { opacity: 0; }
  }
}
@media (prefers-reduced-motion: no-preference) {
  .ink path { stroke-dasharray: 1; }
  .sheet .ink path { animation: ink-draw .7s var(--ink-draw) backwards; }
  .sheet .ink-circle path { animation-delay: .55s; }
  .sheet .ink-arrow path { animation-delay: 1.15s; animation-duration: .45s; }
  .sheet .margin-note { animation: note-in .5s ease-out 1.35s backwards; }
  .sheet .ink-tick path { animation-delay: 1.5s; animation-duration: .35s; }
  .seat-story.is-armed:not(.has-played) :is(.seat-added, .seat-phase-after strong, .story-line, .story-amount, .story-total) { opacity: 0; }
  .seat-story.is-armed:not(.has-played) .ink path { stroke-dashoffset: 1; }
  .seat-story.has-played .seat-added { animation: seat-added .4s var(--ease-out) backwards; animation-delay: calc(.2s + var(--seat-order) * .11s); }
  .seat-story.has-played .seat-phase-after strong { animation: fade-in .4s ease-out .7s backwards; }
  .seat-story.has-played .story-line { animation: line-in .45s var(--ease-out) backwards; animation-delay: .9s; }
  .seat-story.has-played .story-line + .story-line { animation-delay: 1.05s; }
  .seat-story.has-played .story-amount { animation: line-in .45s var(--ease-out) 1.3s backwards; }
  .seat-story.has-played .story-amount + .story-amount { animation-delay: 1.45s; }
  .seat-story.has-played .story-total { animation: line-in .45s var(--ease-out) 1.7s backwards; }
  .seat-story.has-played .ink path { animation: ink-draw .7s var(--ink-draw) 2.05s backwards; }
}
@keyframes ink-draw { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
@keyframes note-in { from { opacity: 0; transform: translateY(3px); } to { opacity: 1; transform: none; } }
@keyframes seat-added { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
@keyframes line-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
@keyframes fade-in { from { opacity: 0; } }

/* Narrower screens */
@media (max-width: 1180px) {
  .sheet-wrap { grid-template-columns: minmax(0, 1fr); }
  .margin-note { position: static; grid-column: 1 / -1; width: auto; margin-top: 8px; padding-left: 0; }
  .margin-note br { display: none; }
  .margin-note .ink-arrow { display: none; }
  .preview-row.is-flagged { padding-bottom: 14px; }
}
@media (max-width: 960px) {
  .hero-grid { grid-template-columns: minmax(0, 1fr); }
  .hero-description, .hero-side { grid-column: 1; }
  .hero-description { grid-row: auto; margin-top: 28px; }
  .hero-side { grid-row: auto; margin-top: 28px; }
  .sheet-columns, .preview-row { grid-template-columns: minmax(0, 1.3fr) minmax(0, 1.2fr) 96px 96px 132px; column-gap: 14px; padding-inline: 20px; }
  .worked { grid-template-columns: minmax(0, 1fr); gap: 44px; }
  .feature-copy { position: static; }
  .closing { grid-template-columns: minmax(0, 1fr); gap: 28px; }
  .pilot-grid { grid-template-columns: minmax(0, 1fr); gap: 40px; }
}
@media (max-width: 720px) {
  .container { width: calc(100% - 40px); }
  .header-inner { min-height: 60px; gap: 14px; }
  .brand { font-size: 21px; }
  .brand img { width: 26px; height: 26px; }
  .nav { gap: 16px; }
  .nav-secondary, .app-nav-label { display: none; }
  .hero { padding-top: 44px; }
  .hero-label { font-size: 13px; margin-bottom: 16px; }
  .hero h1 { font-size: clamp(38px, 11.4vw, 56px); line-height: 1.02; }
  .hero-description { font-size: 17px; margin-top: 22px; }
  .hero-side { margin-top: 24px; }
  .hero-actions .button { padding-inline: 16px; }
  .sheet-wrap { margin-top: 40px; width: calc(100% - 24px); }
  .sheet-head { flex-direction: column; gap: 4px; padding: 18px 16px 14px; }
  .sheet-head h2 { font-size: 22px; }
  .sheet-columns { display: none; }
  .preview-row { grid-template-columns: minmax(0, 1fr) auto; row-gap: 6px; column-gap: 12px; padding: 14px 16px; border-top: 0; }
  .sheet-head + .sheet-columns + .preview-row { border-top: 1px solid var(--rule); }
  .preview-customer { grid-column: 1; grid-row: 1; }
  .preview-finding { grid-column: 1; grid-row: 2; font-size: 13.5px; gap: 8px; }
  .preview-finding .mark { width: 16px; height: 16px; }
  .preview-num { display: none; }
  .preview-amount { grid-column: 2; grid-row: 1 / span 2; align-self: center; }
  .margin-note { grid-row: 3; font-size: 13px; }
  .worked { padding-block: 80px 72px; }
  .feature-copy p:not(.section-label) { font-size: 16px; }
  .seat-story { padding: 22px 18px 24px; }
  .seat-phase { grid-template-columns: minmax(0, 1fr) auto; row-gap: 8px; }
  .seat-grid { grid-column: 1 / -1; grid-row: 2; grid-template-columns: repeat(24, minmax(0, 9px)); gap: 2px; }
  .seat-grid i { width: auto; }
  .story-line, .story-amount { font-size: 13px; }
  .story-total .ink-circle { right: -10px; }
  .closing { padding-block: 40px 64px; }
  .closing .button { width: 100%; }
  .site-footer { padding: 28px 0 32px; }
  .footer-inner { flex-direction: column; align-items: flex-start; gap: 18px; }
  .footer-links { gap: 18px; flex-wrap: wrap; }
  .app-main { width: calc(100% - 36px); padding-top: 36px; }
  .review-heading { gap: 12px; align-items: flex-end; }
  .review-heading h1 { font-size: 36px; }
  .review-heading .export-button { font-size: 13px; padding: 7px 10px; gap: 6px; flex-shrink: 0; }
  .summary-card { grid-template-columns: 1fr 1fr; margin-top: 24px; }
  .summary-metric { padding: 16px 12px 18px 0; }
  .summary-metric + .summary-metric { padding-left: 16px; }
  .summary-metric.missing-invoice-summary { grid-column: 1 / -1; padding: 16px 0 18px; border-left: 0; border-top: 1px solid var(--rule); }
  .metric-value { font-size: 26px; }
  .missing-invoice-summary .metric-value { font-size: 24px; }
  .list-toolbar { padding: 8px 10px; }
  .row-head { display: none; }
  .review-row { grid-template-columns: minmax(0, 1fr) 112px 12px; gap: 6px 10px; padding: 16px 14px; }
  .customer-cell { grid-column: 1; }
  .finding { grid-column: 1; grid-row: 2; font-size: 13px; gap: 8px; }
  .finding-dot { width: 16px; height: 16px; }
  .row-amount { grid-column: 2; grid-row: 1 / span 2; font-size: 13.5px; }
  .chevron { grid-column: 3; grid-row: 1 / span 2; }
  .review-cta { flex-direction: column; align-items: stretch; gap: 20px; }
  .review-cta h2 { font-size: 26px; }
  .detail-dialog { width: calc(100vw - 24px); max-height: calc(100dvh - 30px); }
  .detail-top { padding: 12px 18px; }
  .detail-body { padding: 22px 20px 26px; }
  .detail-body h2 { font-size: 28px; }
  .detail-amounts { gap: 10px; padding-block: 18px; }
  .detail-amounts .metric-value { font-size: clamp(18px, 5.4vw, 22px); }
  .source-record dl { gap: 6px 12px; }
  .content-narrow { width: calc(100% - 40px); }
  .page-intro { padding: 44px 0 28px; }
  .page-intro h1 { font-size: 38px; }
  .page-intro > p { font-size: 16px; }
  .prose h2 { font-size: 26px; }
  .format-table, .format-table tbody { display: block; }
  .format-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .format-table tbody tr { display: grid; gap: 8px; padding: 16px 0; border-bottom: 1px solid var(--rule); }
  .format-table th, .format-table td { display: block; padding: 0; border: 0; font-size: 14px; line-height: 1.7; }
  .format-table td:first-child { width: auto; }
  .format-table td:first-child br { display: none; }
  .format-table td:first-child code { margin: 0 7px 3px 0; }
  .upload-grid { grid-template-columns: 1fr; }
  .upload-card, .upload-card:first-child, .upload-card:last-child { padding: 20px 0; }
  .upload-card + .upload-card { border-left: 0; border-top: 1px solid var(--rule); }
  .upload-card h2 { margin-top: 10px; }
  .upload-card p { min-height: 0; }
  .upload-actions { flex-direction: column; align-items: flex-start; gap: 20px; }
  .upload-actions .button { width: 100%; }
  .import-page .page-intro { padding-top: 8px; }
  .import-page .page-intro h1 { font-size: 36px; }
  .pilot-contact { padding: 24px 22px; }
  .pilot-contact h2 { font-size: 28px; }
  .pilot-contact .button { width: 100%; white-space: normal; }
  .pilot-price, .renewal-price strong { font-size: 32px; }
  .statement-line { flex-wrap: wrap; row-gap: 10px; }
  .statement-line > span:first-child { max-width: none; flex-basis: 100%; }
}
@media (max-width: 360px) {
  .hero-actions { flex-direction: column; align-items: stretch; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
