:root {
  --ink: #18201d;
  --pine: #173f35;
  --mint: #dcebe2;
  --paper: #f5f0e7;
  --white: #fffdf8;
  --rust: #ba4b2f;
  --line: #d8d0c2;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 85% 10%, rgba(186,75,47,.13), transparent 28rem),
    linear-gradient(115deg, var(--paper), #ede5d8);
  font-family: Georgia, "Times New Roman", serif;
  min-height: 100vh;
}
.masthead {
  padding: 1.2rem clamp(1rem, 4vw, 4rem);
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 2rem;
  border-bottom: 1px solid rgba(23,63,53,.25);
}
.brand { color: var(--rust); font: 900 1.1rem/1 Arial, sans-serif; letter-spacing: .14em; }
.brand span { color: var(--pine); }
.masthead p { margin: 0; color: #53615c; font-size: .9rem; }
main { width: min(1180px, calc(100% - 2rem)); margin: 3rem auto 5rem; }
.upload-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, .8fr);
  gap: clamp(2rem, 6vw, 6rem);
  padding: clamp(1.5rem, 5vw, 4.5rem);
  border: 1px solid var(--line);
  background: rgba(255,253,248,.88);
  box-shadow: 0 25px 70px rgba(38,42,36,.12);
}
.eyebrow { margin: 0 0 .75rem; color: var(--rust); font: 800 .72rem/1 Arial, sans-serif; letter-spacing: .16em; text-transform: uppercase; }
h1, h2 { margin: 0; color: var(--pine); line-height: 1.02; }
h1 { max-width: 11ch; font-size: clamp(2.6rem, 6vw, 5.2rem); font-weight: 500; }
h2 { font-size: clamp(2rem, 4vw, 3.2rem); font-weight: 500; }
.lede { max-width: 40rem; color: #53615c; font-size: 1.05rem; line-height: 1.7; }
form { display: grid; gap: 1rem; align-content: start; }
.drop-zone {
  min-height: 190px;
  padding: 2rem;
  display: grid;
  place-content: center;
  text-align: center;
  border: 2px dashed #8aa095;
  background: var(--mint);
  cursor: pointer;
}
.drop-zone strong { color: var(--pine); font: 800 1.1rem Arial, sans-serif; }
.drop-zone span { margin-top: .4rem; color: #66766f; font-size: .82rem; }
.drop-zone input { position: absolute; opacity: 0; pointer-events: none; }
.options { display: grid; grid-template-columns: 1fr 1fr; gap: .8rem; }
label { color: #53615c; font: 700 .72rem/1.4 Arial, sans-serif; text-transform: uppercase; letter-spacing: .08em; }
select {
  width: 100%;
  margin-top: .35rem;
  padding: .75rem;
  border: 1px solid var(--line);
  background: var(--white);
  color: var(--ink);
  font: 500 .9rem Arial, sans-serif;
}
button {
  padding: .85rem 1.15rem;
  border: 0;
  background: var(--pine);
  color: white;
  font: 800 .82rem Arial, sans-serif;
  letter-spacing: .05em;
  cursor: pointer;
}
button:hover { background: var(--rust); }
button:disabled { opacity: .55; cursor: wait; }
#status { min-height: 1.4rem; color: var(--rust); font: 600 .86rem Arial, sans-serif; }
.progress-shell {
  height: 10px;
  margin-top: .5rem;
  overflow: hidden;
  background: rgba(23,63,53,.12);
}
.progress-bar {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, var(--pine), var(--rust));
  transition: width .2s ease;
}
.review { margin-top: 4rem; }
.review-head { display: flex; align-items: end; justify-content: space-between; gap: 2rem; margin-bottom: 1.5rem; }
#reviewMeta { color: #66766f; }
.exports { display: flex; gap: .5rem; }
.exports button { background: transparent; color: var(--pine); border: 1px solid var(--pine); }
.pages { display: grid; gap: 1rem; }
.page-card { border: 1px solid var(--line); background: var(--white); }
.page-meta { display: flex; align-items: center; gap: .75rem; padding: .8rem 1rem; border-bottom: 1px solid var(--line); font: .8rem Arial, sans-serif; }
.badge { padding: .22rem .5rem; background: var(--mint); color: var(--pine); font-weight: 800; }
.confidence { margin-left: auto; color: #66766f; }
textarea {
  width: 100%;
  min-height: 260px;
  padding: 1.25rem;
  resize: vertical;
  border: 0;
  outline-color: var(--rust);
  color: var(--ink);
  background: transparent;
  font: 1rem/1.65 Consolas, monospace;
}
@media (max-width: 760px) {
  .masthead p { display: none; }
  main { margin-top: 1rem; }
  .upload-card { grid-template-columns: 1fr; }
  .options { grid-template-columns: 1fr; }
  .review-head { align-items: start; flex-direction: column; }
  .exports { width: 100%; }
  .exports button { flex: 1; }
}
