/* One solid page colour and Source Serif 4 (bundled, SIL OFL). */
@font-face { font-family: "Source Serif 4"; font-style: normal; font-weight: 200 900; font-display: swap;
  src: url("fonts/source-serif-4-latin-wght-normal.woff2") format("woff2"); }
@font-face { font-family: "Source Serif 4"; font-style: italic; font-weight: 200 900; font-display: swap;
  src: url("fonts/source-serif-4-latin-wght-italic.woff2") format("woff2"); }

:root {
  --paper: #f4f0e6; --ink: #1d1c1a; --muted: #67645b; --rule: #cfc9b8;
  --serif: "Source Serif 4", "Iowan Old Style", Charter, Georgia, ui-serif, serif;
}
@media (prefers-color-scheme: dark) {
  :root { --paper: #000; --ink: #e9e7e1; --muted: #9c9a92; --rule: #2e2f2d; }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 400 18px/1.6 var(--serif); }
.page { max-width: 680px; margin: 0 auto; padding: 56px 20px 40px; }

p { margin: 0 0 .85em; text-align: justify; hyphens: auto; -webkit-hyphens: auto; }
.muted { color: var(--muted); }
a { color: var(--ink); text-decoration-thickness: 1px; text-underline-offset: 3px; }

/* opening */
h1 { font: 700 2rem/1.2 var(--serif); letter-spacing: -.015em; margin: 0 0 14px; }
.lede { color: var(--muted); }

h2 { display: flex; gap: 14px; align-items: baseline; margin: 44px 0 14px; font: 600 1.15rem/1.3 var(--serif); }
.chap { flex: none; min-width: 1.2em; font-weight: 400; font-style: italic; color: var(--muted); }

/* file picker */
.drop { display: grid; gap: 4px; justify-items: center; text-align: center; padding: 28px 16px;
  border: 1.5px dashed var(--muted); cursor: pointer; border-radius: 4px; }
.drop:hover, .drop.over, .drop:focus-within { border-style: solid; border-color: var(--ink); }
.drop input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.drop-title { font-weight: 600; }

/* controls: ink on paper */
input:not([type]), input[inputmode], select, textarea {
  width: 100%; padding: 8px 10px; border: 1px solid var(--ink); border-radius: 3px;
  background: transparent; color: var(--ink); font: inherit; font-size: .95rem; }
textarea { font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace; font-size: .8rem; line-height: 1.45; resize: vertical; }
input[type=checkbox] { accent-color: var(--ink); width: 1.05em; height: 1.05em; }
:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; }
button { font: 600 .95rem var(--serif); padding: 9px 18px; border: 1.5px solid var(--ink); border-radius: 3px;
  background: transparent; color: var(--ink); cursor: pointer; }
button:hover { background: var(--ink); color: var(--paper); }
button.primary { background: var(--ink); color: var(--paper); }
button.primary:hover { background: transparent; color: var(--ink); }

/* a warning reads as a margin note */
.notes { list-style: none; padding: 0; margin: 0 0 16px; display: grid; gap: 10px; }
.notes li { padding: 2px 0 2px 14px; border-left: 4px solid var(--ink); font-style: italic; font-size: .95rem; }
.error { margin: 24px 0 0; padding: 12px 14px; border: 2px solid var(--ink); font-weight: 600; }
.status { font-size: .85rem; min-height: 1.4em; margin: 6px 0 0; color: var(--muted); text-align: left; }
.status.good::before { content: "✓ "; }
.status.bad { color: var(--ink); font-weight: 600; }
.status.bad::before { content: "✗ "; }

/* preview table */
.table-wrap { margin-top: 20px; overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: .82rem; }
caption { text-align: left; font-style: italic; color: var(--muted); padding-bottom: 6px; }
th, td { text-align: left; padding: 5px 12px 5px 0; border-top: 1px solid var(--rule); white-space: nowrap;
  max-width: 240px; overflow: hidden; text-overflow: ellipsis; }
th { font-weight: 600; font-size: .72rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted);
  border-top: 0; border-bottom: 2px solid var(--ink); }

/* advanced options live in an appendix */
details { margin-top: 48px; border-top: 1px solid var(--rule); }
summary { cursor: pointer; padding: 14px 0; font-weight: 600; font-size: 1rem; }
.adv { padding: 0 0 8px; font-size: .95rem; }
.row { display: flex; flex-wrap: wrap; gap: 10px; align-items: end; margin-bottom: 14px; }
.row label { display: grid; gap: 4px; font-size: .8rem; color: var(--muted); flex: 1 1 140px; }
.row label.check { flex: 0 0 auto; display: flex; gap: 6px; align-items: center; padding-bottom: 9px; }
.block { display: block; font-size: .8rem; color: var(--muted); margin-bottom: 4px; }

