/* PDF2Sheet — design system
   No frameworks, no web fonts, no CDN. Everything self-hosted. */

:root {
  --ink: #0b1220;
  --ink-2: #1e293b;
  --body: #334155;
  --muted: #64748b;
  --line: #e2e8f0;
  --line-2: #cbd5e1;
  --bg: #ffffff;
  --bg-2: #f8fafc;
  --bg-3: #f1f5f9;
  --brand: #0f766e;
  --brand-2: #0d9488;
  --brand-ink: #064e3b;
  --brand-soft: #ecfdf5;
  --accent: #b45309;
  --accent-soft: #fffbeb;
  --danger: #b91c1c;
  --ok: #15803d;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 1px 2px rgba(15, 23, 42, .06), 0 8px 24px -12px rgba(15, 23, 42, .18);
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, .06);
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.65;
  color: var(--body);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 { color: var(--ink); line-height: 1.25; margin: 0 0 .5em; font-weight: 700; letter-spacing: -.015em; }
h1 { font-size: clamp(1.85rem, 4vw, 2.75rem); }
h2 { font-size: clamp(1.35rem, 2.6vw, 1.75rem); margin-top: 2.2em; }
h3 { font-size: 1.125rem; margin-top: 1.6em; }
p { margin: 0 0 1.05em; }
a { color: var(--brand); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--brand-2); }
strong { color: var(--ink-2); font-weight: 650; }
small { font-size: .85rem; }
code, kbd { font-family: var(--mono); font-size: .88em; background: var(--bg-3); padding: .12em .4em; border-radius: 5px; color: var(--ink-2); }
hr { border: 0; border-top: 1px solid var(--line); margin: 2.5em 0; }
img, svg { max-width: 100%; }

.wrap { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 20px; }
.narrow { max-width: 760px; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ---------------------------------------------------------------- header */

.site-head {
  position: sticky; top: 0; z-index: 40;
  background: rgba(255, 255, 255, .88);
  backdrop-filter: saturate(160%) blur(8px);
  border-bottom: 1px solid var(--line);
}
.site-head .wrap { display: flex; align-items: center; gap: 18px; height: 62px; }
.logo { display: flex; align-items: center; gap: 9px; font-weight: 750; color: var(--ink); text-decoration: none; letter-spacing: -.02em; font-size: 1.05rem; }
.logo svg { width: 26px; height: 26px; flex: none; }
.logo span b { color: var(--brand); font-weight: 750; }
.nav { margin-left: auto; display: flex; align-items: center; gap: 4px; min-width: 0; }
.nav a {
  color: var(--muted); text-decoration: none; font-size: .9rem; font-weight: 550;
  padding: 7px 11px; border-radius: 8px; white-space: nowrap;
}
.nav a:hover { color: var(--ink); background: var(--bg-3); }
.nav a[aria-current="page"] { color: var(--brand); background: var(--brand-soft); }
.nav-toggle { display: none; }
.logo { flex: none; }

@media (max-width: 860px) {
  .nav { gap: 0; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
  .nav::-webkit-scrollbar { display: none; }
  .nav a { padding: 6px 9px; font-size: .84rem; }
  .site-head .wrap { gap: 10px; height: 56px; }
  .logo span { display: none; }
}
@media (max-width: 640px) {
  .nav a:nth-child(n+3) { display: none; }
}
@media (max-width: 560px) {
  .dropzone { margin: 12px; padding: 26px 14px; }
  .dropzone h2 { font-size: .97rem; }
  .dropzone p { font-size: .8rem; line-height: 1.5; }
  .eyebrow { font-size: .68rem; padding: 5px 9px; }
  .toolbar { padding: 12px 14px; }
  .toolbar .meta { width: 100%; margin-bottom: 8px; }
  .preview-head { flex-direction: column; gap: 2px; align-items: flex-start; }
}

/* ------------------------------------------------------------------ hero */

.hero { padding-top: 44px; padding-bottom: 8px; text-align: center; }
.hero h1 { max-width: 20ch; margin-inline: auto; }
.hero .lede { font-size: clamp(1rem, 2vw, 1.15rem); color: var(--muted); max-width: 62ch; margin: 0 auto 1.2em; }

.eyebrow {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: .78rem; font-weight: 650; letter-spacing: .04em; text-transform: uppercase;
  color: var(--brand-ink); background: var(--brand-soft);
  border: 1px solid #ccfbf1; padding: 5px 11px; border-radius: 999px; margin-bottom: 16px;
}
.eyebrow svg { width: 13px; height: 13px; }

.trustbar {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 22px;
  margin: 18px 0 0; padding: 0; list-style: none;
  font-size: .86rem; color: var(--muted);
}
.trustbar li { display: flex; align-items: center; gap: 6px; }
.trustbar svg { width: 15px; height: 15px; color: var(--ok); flex: none; }

/* ------------------------------------------------------------------ tool */

.tool {
  margin: 26px auto 8px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.dropzone {
  position: relative;
  display: block;              /* label is inline by default — borders and
                                  vertical padding would not lay out correctly */
  margin: 18px;
  padding: 34px 22px;
  border: 2px dashed var(--line-2);
  border-radius: var(--radius-sm);
  background: var(--bg-2);
  text-align: center;
  transition: border-color .15s, background .15s;
  cursor: pointer;
}
.dropzone:hover, .dropzone:focus-visible { border-color: var(--brand-2); background: var(--brand-soft); outline: none; }
.dropzone.is-over { border-color: var(--brand); background: var(--brand-soft); }
/* Opened over file://, where the app cannot start — see the OFFLINE_GUARD note
   in _build/layout.js. Pretend to be disabled so the widget does not invite a
   click that is guaranteed to do nothing. */
.dropzone.is-offline { opacity: .55; cursor: not-allowed; }
.dropzone.is-offline:hover { border-color: var(--line-2); background: var(--bg-2); }
.dropzone.is-busy { pointer-events: none; opacity: .75; }
.dropzone svg.dz-icon { display: block; width: 44px; height: 44px; color: var(--brand); margin: 0 auto 12px; }
.dropzone h2 { font-size: 1.06rem; margin: 0 0 5px; }
.dropzone p { margin: 0; font-size: .88rem; color: var(--muted); }
.dropzone input[type="file"] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  font: inherit; font-size: .92rem; font-weight: 600;
  padding: 10px 18px; border-radius: 9px; border: 1px solid var(--line-2);
  background: var(--bg); color: var(--ink-2); cursor: pointer;
  transition: background .12s, border-color .12s, color .12s;
  text-decoration: none;
}
.btn:hover { background: var(--bg-3); }
.btn-primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-2); border-color: var(--brand-2); color: #fff; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-sm { padding: 6px 12px; font-size: .83rem; }

.status {
  margin: 0 18px 14px;
  padding: 10px 14px;
  border-radius: 9px;
  font-size: .88rem;
  background: var(--bg-3);
  color: var(--ink-2);
  display: flex; align-items: center; gap: 9px;
}
.status[hidden] { display: none; }
.status.is-error { background: #fef2f2; color: var(--danger); border: 1px solid #fecaca; }
.status.is-ok { background: var(--brand-soft); color: var(--brand-ink); border: 1px solid #ccfbf1; }
.status code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: .84em; padding: 1px 5px; border-radius: 4px;
  background: rgba(15, 23, 42, .07); white-space: nowrap;
}
.status .spin {
  width: 14px; height: 14px; border-radius: 50%; flex: none;
  border: 2px solid var(--line-2); border-top-color: var(--brand);
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.options {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px 22px;
  padding: 18px;
  border-top: 1px solid var(--line);
}
.options[hidden] { display: none; }
@media (max-width: 900px) { .options { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px) { .options { grid-template-columns: 1fr; gap: 14px; } }
.field label { display: block; font-size: .8rem; font-weight: 600; color: var(--ink-2); margin-bottom: 5px; }
.field select, .field input[type="text"] {
  width: 100%; font: inherit; font-size: .88rem; padding: 8px 10px;
  border: 1px solid var(--line-2); border-radius: 8px; background: var(--bg); color: var(--ink-2);
}
.field select:focus, .field input:focus { outline: 2px solid var(--brand-soft); border-color: var(--brand-2); }
/* Specificity note: .check must beat ".field label { display:block }",
   so it is qualified with the field class rather than left bare. */
.field label.check {
  display: flex; gap: 9px; align-items: flex-start;
  font-size: .84rem; font-weight: 500; color: var(--body);
  cursor: pointer; margin-bottom: 0;
}
.field label.check input { margin: 3px 0 0; accent-color: var(--brand); flex: none; width: auto; }
.check span { display: block; flex: 1; }
.check .hint { display: block; font-size: .76rem; font-weight: 400; color: var(--muted); margin-top: 2px; }
.hint { font-size: .76rem; color: var(--muted); margin-top: 4px; }

.toolbar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px;
  padding: 14px 18px; border-top: 1px solid var(--line); background: var(--bg-2);
}
.toolbar[hidden] { display: none; }
.toolbar .meta { font-size: .84rem; color: var(--muted); margin-right: auto; }
.toolbar .meta b { color: var(--ink-2); font-weight: 650; }

/* --------------------------------------------------------------- preview */

.preview { border-top: 1px solid var(--line); }
.preview[hidden] { display: none; }
.preview-head {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 18px; font-size: .82rem; color: var(--muted);
  border-bottom: 1px solid var(--line); background: var(--bg);
}
.preview-head b { color: var(--ink-2); }
.table-scroll { overflow: auto; max-height: 460px; }
table.grid {
  border-collapse: separate; border-spacing: 0;
  width: 100%; font-size: .82rem; font-family: var(--mono); table-layout: fixed;
}
table.grid th, table.grid td {
  border-right: 1px solid var(--line); border-bottom: 1px solid var(--line);
  padding: 5px 9px; text-align: left; white-space: nowrap;
  max-width: 340px; overflow: hidden; text-overflow: ellipsis;
}
table.grid th {
  position: sticky; top: 0; z-index: 2;
  background: var(--bg-3); color: var(--ink-2); font-weight: 650;
  font-family: var(--sans); font-size: .78rem;
}
table.grid td.num { text-align: right; color: var(--brand-ink); }
table.grid tbody tr:nth-child(even) td { background: #fcfdfe; }
table.grid td[contenteditable="true"]:focus { outline: 2px solid var(--brand-2); background: #fff; }
.preview-more { padding: 9px 18px; font-size: .8rem; color: var(--muted); border-top: 1px solid var(--line); }

/* ---------------------------------------------------------------- blocks */

/* Vertical rhythm only — horizontal padding belongs to .wrap, and a shorthand
   here would silently wipe it out. */
.section { padding-block: 34px; }
.section.alt { background: var(--bg-2); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }

.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 20px; margin: 26px 0 0; padding: 0; list-style: none; counter-reset: s; }
.steps li { position: relative; padding-left: 46px; }
.steps li::before {
  counter-increment: s; content: counter(s);
  position: absolute; left: 0; top: 1px;
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--brand-soft); color: var(--brand-ink);
  border: 1px solid #ccfbf1;
  display: grid; place-items: center; font-weight: 700; font-size: .88rem;
}
.steps h3 { margin: 0 0 4px; font-size: 1rem; }
.steps p { margin: 0; font-size: .9rem; color: var(--muted); }

.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 16px; margin-top: 24px; }
.card {
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 18px; background: var(--bg);
}
.card h3 { margin: 0 0 6px; font-size: .98rem; display: flex; align-items: center; gap: 8px; }
.card p { margin: 0; font-size: .89rem; color: var(--muted); }
.card svg { width: 18px; height: 18px; color: var(--brand); flex: none; }

.callout {
  border-left: 3px solid var(--brand-2);
  background: var(--brand-soft);
  padding: 14px 18px; border-radius: 0 10px 10px 0;
  margin: 1.6em 0; font-size: .93rem;
}
.callout p:last-child { margin-bottom: 0; }
.callout.warn { border-left-color: var(--accent); background: var(--accent-soft); }

.faq { margin-top: 10px; border-top: 1px solid var(--line); }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary {
  cursor: pointer; padding: 15px 30px 15px 0; font-weight: 600; color: var(--ink);
  font-size: .96rem; list-style: none; position: relative;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: ""; position: absolute; right: 6px; top: 50%;
  width: 8px; height: 8px; margin-top: -6px;
  border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted);
  transform: rotate(45deg); transition: transform .15s;
}
.faq details[open] summary::after { transform: rotate(-135deg); margin-top: -2px; }
.faq details > *:not(summary) { font-size: .92rem; color: var(--body); margin: 0 0 1em; }

.cols-2 { columns: 2; column-gap: 40px; }
@media (max-width: 700px) { .cols-2 { columns: 1; } }

ul.ticks { list-style: none; padding: 0; margin: 0 0 1.2em; }
ul.ticks li { position: relative; padding-left: 26px; margin-bottom: 8px; font-size: .94rem; }
ul.ticks li::before {
  content: ""; position: absolute; left: 2px; top: .55em;
  width: 12px; height: 7px; border-left: 2px solid var(--ok); border-bottom: 2px solid var(--ok);
  transform: rotate(-45deg);
}
ul.plain { padding-left: 1.2em; }
ul.plain li { margin-bottom: .5em; }

.table-wrap { overflow-x: auto; margin: 1.4em 0; }
table.data { border-collapse: collapse; width: 100%; font-size: .88rem; }
table.data th, table.data td { border: 1px solid var(--line); padding: 8px 12px; text-align: left; vertical-align: top; }
table.data th { background: var(--bg-3); font-weight: 650; color: var(--ink-2); }

.links-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 12px; margin-top: 20px; }
.links-grid a {
  display: block; padding: 14px 16px; border: 1px solid var(--line); border-radius: 10px;
  text-decoration: none; background: var(--bg); transition: border-color .12s, transform .12s;
}
.links-grid a:hover { border-color: var(--brand-2); transform: translateY(-1px); }
.links-grid strong { display: block; color: var(--ink); font-size: .93rem; margin-bottom: 2px; }
.links-grid span { font-size: .82rem; color: var(--muted); }

.breadcrumb { font-size: .8rem; color: var(--muted); margin: 18px 0 0; }
.breadcrumb a { color: var(--muted); text-decoration: none; }
.breadcrumb a:hover { color: var(--brand); }
.breadcrumb span { margin: 0 6px; }

/* ------------------------------------------------------------ prose pages */

.prose h2 { margin-top: 2em; }
.prose h3 { margin-top: 1.5em; }
.prose p, .prose li { font-size: .96rem; }
.prose > *:first-child { margin-top: 0; }

/* ----------------------------------------------------------------- footer */

.site-foot {
  border-top: 1px solid var(--line); background: var(--bg-2);
  padding: 40px 0 28px; margin-top: 40px; font-size: .88rem;
}
.foot-grid { display: grid; grid-template-columns: 1.4fr repeat(3, 1fr); gap: 28px; }
.foot-grid h4 { font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin: 0 0 10px; font-weight: 650; }
.foot-grid ul { list-style: none; margin: 0; padding: 0; }
.foot-grid li { margin-bottom: 7px; }
.foot-grid a { color: var(--body); text-decoration: none; }
.foot-grid a:hover { color: var(--brand); }
.foot-brand p { color: var(--muted); font-size: .85rem; max-width: 34ch; }
.foot-note {
  margin-top: 30px; padding-top: 18px; border-top: 1px solid var(--line);
  display: flex; flex-wrap: wrap; gap: 8px 20px; justify-content: space-between;
  color: var(--muted); font-size: .8rem;
}
@media (max-width: 780px) {
  .foot-grid { grid-template-columns: 1fr 1fr; }
  .foot-brand { grid-column: 1 / -1; }
}

/* ------------------------------------------------------------------ misc */

.mt-0 { margin-top: 0; }
.center { text-align: center; }
.muted { color: var(--muted); }
.nowrap { white-space: nowrap; }
.badge {
  display: inline-block; font-size: .72rem; font-weight: 650; letter-spacing: .03em;
  padding: 2px 8px; border-radius: 999px; background: var(--brand-soft);
  color: var(--brand-ink); border: 1px solid #ccfbf1; vertical-align: middle;
}

@media print {
  .site-head, .site-foot, .tool, .nav { display: none !important; }
}
