/* ParsePDF AI — layout and colours follow addpersonai.com (Richscripts house style): white top bar,
   left-aligned hero, blue brand colour, tool in a two-column bordered panel, soft grey footer. */
:root {
  --ink: #18181b; --ink-2: #35353a; --muted: #57575f; --faint: #626269; --line: #e5e5e8; --line-2: #c9c9cf;
  --bg: #f8fafd; --panel: #fff; --soft: #f0f4f9; --brand: #0b57d0; --brand-d: #0842a0; --brand-l: #e8f0fe;
  --ok: #137333; --ok-l: #e6f4ea; --warn: #8a6100; --warn-bg: #fef7e0; --bad: #b3261e; --bad-bg: #fce8e6;
  --r: 12px; --r-sm: 8px;
  --font: "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
  --mono: Consolas, "SFMono-Regular", Menlo, monospace;
}
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; font: 16px/1.6 var(--font); color: var(--ink); background: var(--bg); }
img, svg { max-width: 100%; }
a { color: var(--brand); }
a:hover { color: var(--brand-d); }
h1, h2, h3 { line-height: 1.25; margin: 0 0 .5em; text-wrap: balance; }
h1 { font-size: clamp(1.9rem, 4.2vw, 2.75rem); letter-spacing: -.02em; line-height: 1.12; }
h2 { font-size: 1.4rem; }
h3 { font-size: 1.08rem; }
p { margin: 0 0 1em; }
code, pre { font-family: var(--mono); font-size: .92em; }
code { background: var(--soft); padding: .1em .35em; border-radius: 4px; word-break: break-word; }
pre code { background: none; padding: 0; }
.wrap { max-width: 1180px; margin: 0 auto; padding: 0 20px; }
.narrow { max-width: 820px; margin: 0 auto; padding: 0 20px; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 12px; top: 12px; z-index: 99; background: #fff; padding: 8px 12px; border-radius: 6px; }
:focus-visible { outline: 3px solid #73737c; outline-offset: 2px; }
.ic { flex: none; vertical-align: -3px; }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .45em; border: 1px solid var(--brand); background: var(--brand); color: #fff; font: 600 .95rem/1 var(--font); padding: .75em 1.25em; border-radius: 6px; cursor: pointer; text-decoration: none; white-space: nowrap; }
.btn:hover { background: var(--brand-d); border-color: var(--brand-d); color: #fff; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.secondary { background: #fff; color: var(--ink); border-color: var(--line-2); }
.btn.secondary:hover { background: var(--soft); color: var(--ink); border-color: var(--line-2); }
.btn.lg { font-size: 1rem; padding: .9em 1.5em; }
.btn.small { font-size: .875rem; padding: .55em .95em; }
.btn.block { width: 100%; white-space: normal; line-height: 1.3; }
.linkbtn { background: none; border: 0; padding: 0; color: var(--brand); font: inherit; text-decoration: underline; cursor: pointer; }

/* header */
.topbar { background: #fff; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.topbar-row { display: flex; align-items: center; gap: 20px; min-height: 66px; flex-wrap: wrap; padding-block: 6px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font-size: 20px; font-weight: 700; letter-spacing: -.6px; margin-right: auto; }
.brand b { color: var(--brand); }
.brand small { font-size: .7em; font-weight: 600; color: var(--brand); letter-spacing: 0; }
.brand-mark { display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 8px; background: var(--brand); color: #fff; flex: none; }
#primary-nav { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
#primary-nav a:not(.btn) { color: var(--ink-2); text-decoration: none; padding: .45em .7em; border-radius: 6px; font-weight: 500; font-size: .95rem; }
#primary-nav a:not(.btn):hover, #primary-nav a[aria-current="page"]:not(.btn) { background: var(--soft); color: var(--ink); }
#primary-nav .btn { margin-left: 8px; }

/* hero */
.hero { padding: 44px 0 20px; }
.hero h1 { margin-bottom: .3em; max-width: 26ch; }
.hero h1 em { font-style: normal; color: var(--brand); }
.lead, .lede { font-size: 1.08rem; color: var(--ink-2); max-width: 820px; }
.hero-points { display: flex; flex-wrap: wrap; gap: 8px 22px; list-style: none; padding: 0; margin: 0 0 20px; color: var(--ink-2); font-size: 13.5px; }
.hero-points li { display: flex; align-items: center; gap: 6px; }
.hero-points li::before { content: "✓"; color: var(--brand); font-weight: 700; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }

/* tool */
.tool { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; margin: 8px 0 14px; overflow: hidden; }
.tool-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 12px 20px; border-bottom: 1px solid var(--line); }
.tool-head h2 { margin: 0; font-size: 1.1rem; }
.badge { display: inline-flex; align-items: center; gap: 6px; font-size: .82rem; font-weight: 600; color: var(--ink-2); background: var(--soft); border-radius: 999px; padding: .4em .9em; }
.badge::before { content: "✓"; color: var(--ok); }
.tool-grid { display: grid; grid-template-columns: minmax(0, .85fr) minmax(0, 1.15fr); }
.panel { padding: 20px 22px; min-width: 0; }
.panel-input { border-right: 1px solid var(--line); }
.panel-preview { background: #fafafa; padding: 0; display: flex; flex-direction: column; min-height: 420px; }
.label { display: block; font-weight: 600; font-size: .9rem; margin-bottom: 6px; color: var(--ink-2); }
.hint { font-size: .82rem; color: var(--muted); margin: 6px 0 0; }
.drop { display: flex; align-items: center; justify-content: center; gap: 8px; text-align: center; border: 2px dashed var(--line-2); border-radius: var(--r); padding: 22px 14px; background: #fafafa; cursor: pointer; color: var(--ink-2); font-weight: 500; width: 100%; font: 500 .98rem var(--font); }
.drop:hover, .drop.over { border-color: var(--brand); background: var(--brand-l); color: var(--brand-d); }
.notice { border-radius: var(--r-sm); padding: 11px 14px; margin: 14px 0 0; font-size: .92rem; border: 1px solid; }
.notice.info { background: var(--brand-l); border-color: #c6dafc; color: #0b3d91; }
.notice.warn { background: var(--warn-bg); border-color: #f1dfa3; color: #5c4100; }
.notice.bad { background: var(--bad-bg); border-color: #f4c7c3; color: var(--bad); }
.notice.ok { background: var(--ok-l); border-color: #b7dfc3; color: #0d5226; }
.file-box { margin-top: 18px; border-top: 1px solid var(--line); padding-top: 16px; }
.file-name { font-weight: 600; overflow-wrap: anywhere; }
.file-meta { color: var(--muted); font-size: .88rem; margin-bottom: 12px; }
.result-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.upsell { margin-top: 18px; border: 1px solid #c6dafc; background: var(--brand-l); border-radius: var(--r); padding: 16px; }
.upsell h3 { margin-bottom: 6px; font-size: 1.02rem; }
.upsell p { font-size: .92rem; color: var(--ink-2); margin-bottom: 12px; }
.upsell .estimate { font-weight: 600; color: var(--ink); }
.upsell .fine { font-size: .8rem; color: var(--muted); margin: 10px 0 0; }
.progress { height: 6px; background: #fff; border-radius: 99px; overflow: hidden; margin-top: 10px; }
.progress i { display: block; height: 100%; width: 0; background: var(--brand); transition: width .2s; }
.preview-head { padding: 12px 20px; border-bottom: 1px solid var(--line); font-weight: 600; font-size: .9rem; color: var(--ink-2); background: #fff; }
.placeholder { flex: 1; display: grid; place-items: center; text-align: center; color: var(--muted); padding: 40px 24px; font-size: .95rem; }
.placeholder svg { color: var(--line-2); margin-bottom: 10px; }
.pages { flex: 1; max-height: 640px; overflow: auto; }
.page { border-bottom: 1px solid var(--line); padding: 14px 20px; }
.page:last-child { border-bottom: 0; }
.page-label { font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; font-weight: 700; color: var(--faint); margin-bottom: 6px; }
.page pre { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; font-size: .84rem; line-height: 1.6; color: var(--ink); tab-size: 4; }
.page .empty { color: var(--faint); font-style: italic; font-size: .9rem; }
.trust { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px 28px; font-size: .9rem; color: var(--ink-2); margin: 0 4px 8px; }
.trust p { margin: 0; }

/* sections */
.section { padding: 44px 0 0; }
.section h2 { margin-bottom: 16px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.grid2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.card { display: block; background: #fff; border: 1px solid var(--line); border-radius: var(--r); padding: 1.1em 1.25em; color: var(--ink); }
a.card:hover { border-color: var(--brand); color: var(--ink); }
.card h3 { margin-bottom: 6px; }
.card p:last-child, .card ul:last-child { margin-bottom: 0; }
.card p, .card li { color: var(--ink-2); font-size: .94rem; }
.step-n { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--brand-l); color: var(--brand-d); font-size: .85rem; font-weight: 700; margin-bottom: 10px; }
.price-card { border: 2px solid var(--brand); }
.price { font-size: 2.5rem; font-weight: 700; letter-spacing: -.03em; line-height: 1; margin: 6px 0 4px; }
.price small { font-size: .95rem; font-weight: 500; letter-spacing: 0; color: var(--muted); }
.ticks { list-style: none; padding: 0; margin: 12px 0 16px; }
.ticks li { padding: 3px 0 3px 24px; position: relative; }
.ticks li::before { content: "✓"; position: absolute; left: 2px; color: var(--ok); font-weight: 700; }
.ticks.no li::before { content: "–"; color: var(--faint); }
.sample-out { background: #18181b; color: #e4e4e7; border-radius: var(--r); padding: 16px 18px; font: .84rem/1.7 var(--mono); overflow: auto; margin: 0; }
.sample-out .k { color: #a8c7fa; } .sample-out .v { color: #f6c177; } .sample-out .c { color: #a1a1aa; }

/* long-form pages */
.doc { padding: 36px 0 0; }
.doc h2 { margin-top: 1.7em; }
.doc h3 { margin-top: 1.3em; }
.doc .meta { color: var(--muted); font-size: .88rem; border-bottom: 1px solid var(--line); padding-bottom: 14px; margin-bottom: 22px; }
.doc ul, .doc ol { padding-left: 1.3em; margin: 0 0 1em; }
.doc li { margin-bottom: .35em; }
.doc pre { background: #18181b; color: #e4e4e7; padding: 14px 16px; border-radius: var(--r-sm); overflow: auto; line-height: 1.6; font-size: .84rem; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r); background: #fff; margin: 0 0 1.2em; }
table { border-collapse: collapse; width: 100%; font-size: .92rem; }
th, td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
thead th { background: var(--soft); font-size: .84rem; white-space: nowrap; }
tbody tr:last-child > * { border-bottom: 0; }
tbody th { font-weight: 600; }
td.us { background: #f5f9ff; }
.cta { background: var(--brand-l); border: 1px solid #c6dafc; border-radius: var(--r); padding: 22px 24px; display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-top: 36px; }
.cta h2 { margin: 0 0 2px; font-size: 1.25rem; }
.cta p { margin: 0; color: var(--ink-2); }
.faq details { background: #fff; border: 1px solid var(--line); border-radius: var(--r-sm); padding: 12px 16px; margin-bottom: 8px; }
.faq summary { font-weight: 600; cursor: pointer; }
.faq details p { margin: 8px 0 0; color: var(--ink-2); font-size: .94rem; }

/* order page */
.order { padding: 44px 0 0; }
.status-card { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 30px; text-align: center; }
.status-card h1 { font-size: clamp(1.5rem, 3.4vw, 2rem); max-width: none; }
.status-card .sub { color: var(--ink-2); margin-bottom: 20px; }
.spinner { width: 36px; height: 36px; border-radius: 50%; border: 4px solid var(--soft); border-top-color: var(--brand); margin: 0 auto 16px; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.facts { display: flex; justify-content: center; gap: 8px 22px; flex-wrap: wrap; color: var(--muted); font-size: .92rem; margin: 16px 0 0; padding: 0; list-style: none; }

/* footer */
.footer { background: var(--soft); border-top: 1px solid var(--line); padding: 48px 0 36px; margin-top: 56px; font-size: .92rem; color: var(--ink-2); }
.footer-grid { display: grid; grid-template-columns: 1.3fr 1fr 1fr 1fr; gap: 32px; margin-bottom: 28px; }
.footer-brand { font-weight: 700; font-size: 18px; letter-spacing: -.4px; color: var(--ink); margin-bottom: .3em; }
.footer-h { font-size: 13px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--faint); margin: 0 0 12px; }
.footer-grid a { display: block; color: var(--ink-2); text-decoration: none; padding: 3px 0; overflow-wrap: anywhere; }
.footer-grid a:hover { color: var(--brand); text-decoration: underline; }
.footer-more { border-top: 1px solid var(--line); padding-top: 18px; font-size: .86rem; }
.footer-more strong { display: block; color: var(--ink); margin-bottom: 4px; }
.footer-more p { margin: 0 0 2px; }
.footer-more a { color: var(--ink-2); }
.footer-legal { font-size: .8rem; color: var(--muted); margin-top: 14px; }
.footer-legal a { color: var(--muted); }

@media (max-width: 900px) {
  .tool-grid { grid-template-columns: 1fr; }
  .panel-input { border-right: 0; border-bottom: 1px solid var(--line); }
  .panel-preview { min-height: 260px; }
  .grid3, .grid2, .trust { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .hero { padding: 30px 0 14px; }
}
@media (max-width: 560px) {
  .footer-grid { grid-template-columns: 1fr; }
  #primary-nav .btn { display: none; }
  .topbar-row { gap: 6px; }
  .status-card { padding: 22px 16px; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } * { transition: none !important; } .spinner { animation-duration: 3s; } }

/* One local PDF page and its matching structured output. */
.tool-grid { display:block; }
.panel-input { display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1fr); gap:6px 24px; border-right:0; border-bottom:1px solid var(--line); }
.panel-input > .label, .panel-input > .drop, .panel-input > .hint, .panel-input > #message { grid-column:1; }
.panel-input .file-box { grid-column:2; grid-row:1 / span 6; margin:0; border:0; padding:0; }
.panel-input .upsell { margin-top:10px; }
.preview-controls { display:flex; flex-wrap:wrap; align-items:center; justify-content:space-between; gap:12px; padding:12px 16px; border-bottom:1px solid var(--line); font-size:.9rem; }
.preview-workspace { display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1fr); min-height:480px; }
.pdf-pane { min-width:0; padding:16px; background:#e5e9f0; max-height:720px; overflow:auto; text-align:center; }
.pdf-pane canvas { display:block; margin:auto; max-width:100%; height:auto; background:white; box-shadow:0 2px 10px #18243b20; }
.output-pane { min-width:0; background:white; border-left:1px solid var(--line); }
.preview-tabs { display:flex; gap:4px; padding:10px; border-bottom:1px solid var(--line); overflow-x:auto; }
.preview-tabs button { flex:1; border:1px solid transparent; background:transparent; color:var(--muted); border-radius:6px; padding:10px; font:600 .9rem var(--font); cursor:pointer; }
.preview-tabs button[aria-selected="true"] { background:var(--brand-l); border-color:#c6dafc; color:var(--brand-d); }
.pages { padding:16px; max-height:650px; min-height:300px; }
.pages pre { margin:0; white-space:pre-wrap; overflow-wrap:anywhere; font-size:.875rem; line-height:1.65; tab-size:4; }
.preview-note { margin:0; padding:12px 16px; background:var(--soft); color:var(--muted); font-size:.875rem; }
.panel-preview > .upsell { margin:16px; padding:16px; }
.panel-preview > .upsell .btn { max-width:420px; }
.preview-table { width:100%; border-collapse:collapse; font-size:.875rem; margin-bottom:20px; }
.preview-table caption { text-align:left; font-weight:600; padding-bottom:8px; }
.preview-table th,.preview-table td { padding:8px; border:1px solid var(--line); text-align:left; overflow-wrap:anywhere; }
.preview-table th { background:var(--soft); }
@media(max-width:760px) {
  .panel-input { display:block; }
  .panel-input .file-box { margin-top:16px; }
  .preview-workspace { grid-template-columns:minmax(0,1fr); }
  .pdf-pane { max-height:430px; }
  .output-pane { border-left:0; border-top:1px solid var(--line); }
  .preview-controls { gap:8px; }
  .preview-controls span { order:-1; width:100%; text-align:center; }
}
