/* Paper Scrubber — KVEC house style.
   Palette pulled from the cooperative's logo: mountain blue + ridge green,
   set on warm paper rather than the usual cold app grey. */
:root {
  --blue: #1b5ea8;
  --blue-deep: #12457c;
  --blue-wash: #eaf1f9;
  --green: #6db544;
  --green-deep: #4f8b2c;
  --green-wash: #eef6e7;
  --ink: #17293c;
  --ink-soft: #5a6b7c;
  --paper: #fffdf8;
  --bg: #f4f1e9;
  --rule: #ded8ca;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  font-size: 16px;
  line-height: 1.6;
}

h1, h2, .num, .batch-row .b-name {
  font-family: Georgia, "Iowan Old Style", "Times New Roman", serif;
}

main { max-width: 860px; margin: 0 auto; padding: 0 1rem; }

/* ---------- masthead ---------- */
.masthead { background: var(--blue); color: #fff; padding-top: 1.5rem; }
.masthead-inner {
  max-width: 860px; margin: 0 auto; padding: 0 1rem .25rem;
  display: flex; align-items: flex-start; justify-content: space-between; gap: 1.5rem;
}
.wordmark h1 {
  margin: 0; font-size: 2.4rem; line-height: 1.05;
  letter-spacing: -.015em; font-weight: 700;
}
.tagline { margin: .45rem 0 0; font-size: 1.02rem; color: #cfe0f2; max-width: 34rem; }

.coop { text-align: right; flex: none; padding-top: .3rem; }
.coop img { display: block; height: 74px; width: auto; margin: 0 0 .3rem auto; background: #fff; border-radius: 8px; padding: 5px; }
.coop-text { font-size: .78rem; color: #cfe0f2; letter-spacing: .02em; }
.coop-text strong { color: #fff; }

.ridge { display: block; width: 100%; height: 52px; }
.ridge-back { fill: var(--green-deep); opacity: .55; }
.ridge-front { fill: var(--bg); }

/* ---------- trust strip ---------- */
.trust-strip {
  max-width: 860px; margin: 0 auto; padding: 0 1rem 1.4rem;
  display: flex; flex-wrap: wrap; gap: .35rem 1.6rem;
  list-style: none; font-size: .87rem; font-weight: 600; color: var(--green-deep);
}
.trust-strip li::before { content: "✓ "; color: var(--green); font-weight: 800; }

/* ---------- steps ---------- */
.steps {
  list-style: none; margin: 0 0 1.1rem; padding: 0;
  display: grid; grid-template-columns: repeat(3, 1fr); gap: .7rem;
  counter-reset: step;
}
.steps li {
  display: flex; gap: .65rem; align-items: flex-start;
  background: var(--blue-wash); border: 1px solid #cfdff0;
  border-radius: 10px; padding: .7rem .85rem;
}
.steps .num {
  flex: none; width: 1.75rem; height: 1.75rem; border-radius: 50%;
  background: var(--green); color: #fff; font-size: 1.05rem; font-weight: 700;
  display: flex; align-items: center; justify-content: center; line-height: 1;
}
.steps strong { display: block; font-size: .93rem; color: var(--blue-deep); }
.steps span:not(.num) { display: block; font-size: .82rem; color: var(--ink-soft); line-height: 1.4; }

/* ---------- cards ---------- */
.card {
  background: var(--paper);
  border: 1px solid var(--rule);
  border-top: 4px solid var(--blue);
  border-radius: 4px;
  padding: 1.4rem;
  box-shadow: 0 2px 10px rgba(23, 41, 60, .07);
}

/* ---------- input ---------- */
.drop-zone { position: relative; }
#paperText {
  width: 100%; min-height: 230px; resize: vertical;
  font: inherit; font-size: .95rem; line-height: 1.6;
  padding: .95rem 1.05rem;
  border: 2px dashed #c4cdd6; border-radius: 4px;
  background: #fff; color: var(--ink);
}
#paperText::placeholder { color: #8b98a5; }
#paperText:focus { outline: none; border-color: var(--blue); }
.drop-zone.dragging #paperText { border-color: var(--green); background: var(--green-wash); }
.drop-overlay {
  display: none; position: absolute; inset: 0; border-radius: 4px;
  background: rgba(27, 94, 168, .94); color: #fff;
  font-size: 1.25rem; font-weight: 700;
  align-items: center; justify-content: center; pointer-events: none;
}
.drop-zone.dragging .drop-overlay { display: flex; }

.input-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; margin: .85rem 0 .6rem; }
.filetypes { font-size: .84rem; color: var(--ink-soft); margin: 0 0 1.2rem; line-height: 1.5; }
.filetypes code {
  background: var(--blue-wash); color: var(--blue-deep);
  padding: .05em .35em; border-radius: 3px; font-size: .93em;
}
.filetypes strong { color: var(--ink); }

/* ---------- language toggle ---------- */
.mode-toggle {
  display: grid; grid-template-columns: 1fr 1fr; gap: .6rem;
  border: none; padding: 0; margin: 0;
}
.mode-toggle legend {
  font-weight: 700; font-size: .9rem; padding: 0 0 .45rem; color: var(--blue-deep);
}
.mode-opt input { position: absolute; opacity: 0; }
.mode-box {
  display: block; padding: .7rem .9rem; height: 100%; cursor: pointer;
  border: 2px solid var(--rule); border-radius: 4px; background: #fff;
}
.mode-box strong { font-size: .96rem; }
.mode-box small { display: block; color: var(--ink-soft); font-size: .79rem; margin-top: .1rem; }
.mode-opt input:checked + .mode-box { border-color: var(--green); background: var(--green-wash); }
.mode-opt input:focus-visible + .mode-box { outline: 3px solid #bcdca4; }
.mode-note { font-size: .82rem; color: var(--ink-soft); margin: .6rem 0 1.15rem; }

/* ---------- buttons ---------- */
.btn {
  font: inherit; font-weight: 600; cursor: pointer;
  border-radius: 4px; border: 1px solid transparent; padding: .55rem 1.05rem;
  transition: background .12s, border-color .12s;
}
.btn.primary { background: var(--green-deep); color: #fff; }
.btn.primary:hover { background: #3f7423; }
.btn.primary:disabled { background: #b3bcc4; cursor: not-allowed; }
.btn.secondary { background: #fff; color: var(--blue-deep); border-color: var(--blue); }
.btn.secondary:hover { background: var(--blue-wash); }
.btn.ghost { background: none; color: var(--ink-soft); border-color: var(--rule); }
.btn.ghost:hover { background: #f0ece2; color: var(--ink); }
.btn.big { width: 100%; padding: .95rem; font-size: 1.12rem; font-weight: 700; }
.btn.small { padding: .32rem .75rem; font-size: .83rem; }
.btn.link { background: none; border: none; color: var(--blue); padding: 0; font-size: .93rem; font-weight: 600; }
.btn.link:hover { text-decoration: underline; }

/* ---------- status / progress ---------- */
.status { margin-top: 1.1rem; }
.status p { margin: 0 0 .45rem; font-size: .92rem; color: var(--ink-soft); }
.status p.error { color: #a3341f; font-weight: 600; }
.progress {
  height: 9px; background: #e6e0d3; border-radius: 999px;
  overflow: hidden; margin: .45rem 0 .85rem;
}
#progressBar, #batchProgressBar {
  height: 100%; width: 0%; border-radius: 999px;
  background: var(--green); transition: width .2s;
}

/* ---------- batch ---------- */
#batchTitle { margin: .5rem 0 .3rem; font-size: 1.45rem; color: var(--blue-deep); }
.batch-list { display: flex; flex-direction: column; gap: .4rem; margin: 1rem 0 1.3rem; }
.batch-row {
  display: flex; align-items: center; gap: .75rem;
  border: 1px solid var(--rule); border-left: 4px solid var(--green);
  border-radius: 4px; padding: .6rem .85rem; background: #fff;
}
.batch-row .b-icon { font-size: 1.05rem; width: 1.3rem; text-align: center; flex: none; }
.batch-row .b-main { flex: 1; min-width: 0; }
.batch-row .b-name { font-size: 1rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.batch-row .b-sub { font-size: .82rem; color: var(--ink-soft); }
.batch-row .b-sub.err { color: #a3341f; }
.batch-row .b-actions { display: flex; gap: .4rem; flex: none; }

.zip-box {
  background: var(--green-wash); border: 1px solid #c8e0b4;
  border-radius: 4px; padding: 1rem 1.1rem .85rem;
}
.zip-box .hint { margin: .6rem 0 0; text-align: center; }

/* ---------- review ---------- */
.review-nav {
  display: flex; align-items: center; justify-content: space-between;
  gap: .8rem; padding-bottom: .8rem; border-bottom: 1px solid var(--rule); margin-bottom: .9rem;
}
.crumb { font-size: .84rem; color: var(--ink-soft); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#summaryLine { margin: 0 0 .35rem; font-size: 1.35rem; color: var(--blue-deep); }
.hint { font-size: .88rem; color: var(--ink-soft); margin: .25rem 0 .95rem; }
.hint.small { font-size: .81rem; margin-top: .85rem; }
.hint strong { color: var(--ink); }

.legend { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: 1rem; }
.legend label {
  display: inline-flex; align-items: center; gap: .35rem;
  font-size: .81rem; font-weight: 600;
  border: 1px solid var(--rule); border-radius: 3px;
  padding: .22rem .6rem .22rem .45rem; cursor: pointer; background: #fff;
}
.legend label.off { opacity: .4; }
.legend .dot { width: 11px; height: 11px; border-radius: 2px; display: inline-block; border: none; }

.output {
  white-space: pre-wrap; word-wrap: break-word;
  background: #fff; border: 1px solid var(--rule);
  border-radius: 4px; padding: 1.15rem 1.3rem;
  font-size: .95rem; line-height: 1.75;
  max-height: 460px; overflow-y: auto;
}

.result-actions { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: 1.1rem; }

/* ---------- highlight marks ---------- */
mark { padding: .05em .25em; border-radius: 2px; font-weight: 600; cursor: pointer; white-space: nowrap; }
mark.kept {
  background: transparent; color: inherit; font-weight: inherit;
  border-bottom: 2px solid #b9c3cc; white-space: normal;
}
mark.demo { cursor: default; }

.t-name     { background: #ffe08a; color: #6b4a05; }
.t-org      { background: #d4edb9; color: #3d5f1c; }
.t-email    { background: #bcdcf5; color: #10446e; }
.t-phone    { background: #b6e6ea; color: #12525a; }
.t-link     { background: #dfe3e7; color: #34424f; }
.t-username { background: #b9e6cf; color: #14543a; }
.t-password { background: #f9c9c2; color: #8a2c1a; }
.t-ssn      { background: #f6b3ab; color: #7c2415; }
.t-id       { background: #f7c8d4; color: #8a2542; }
.t-address  { background: #d6cdf0; color: #45307c; }
.t-city     { background: #e3d3f2; color: #5a2f7e; }
.t-state    { background: #efd0ee; color: #6f2a6c; }
.t-zip      { background: #f7cde0; color: #86254f; }
.t-dob      { background: #f9bfc7; color: #85253a; }
.t-date     { background: #fbd7ae; color: #8a4a12; }
.t-age      { background: #fbeaa0; color: #755b0c; }

/* ---------- global drop overlay ---------- */
#globalDrop {
  display: none; position: fixed; inset: 0; z-index: 50;
  background: rgba(27, 94, 168, .94); color: #fff;
  font-size: 1.6rem; font-weight: 700;
  align-items: center; justify-content: center; pointer-events: none;
}
body.page-dragging #globalDrop { display: flex; }

/* ---------- footer ---------- */
.site-footer { margin-top: 2.5rem; background: var(--blue); color: #cfe0f2; }
.footer-ridge { height: 38px; transform: scaleY(-1); }
.footer-ridge .ridge-front { fill: var(--bg); }
.footer-inner { max-width: 860px; margin: 0 auto; padding: .25rem 1rem 2rem; text-align: center; }
.coop-line { margin: 0 0 .8rem; font-size: .95rem; color: #fff; line-height: 1.5; }
.coop-line em { color: #b6d5a2; font-size: .89rem; }
.colophon { margin: 0; font-size: .78rem; line-height: 1.6; }
.site-footer a { color: #b6d5a2; }

/* ---------- narrow screens ---------- */
@media (max-width: 700px) {
  .steps { grid-template-columns: 1fr; }
  .mode-toggle { grid-template-columns: 1fr; }
  .masthead-inner { flex-direction: column; gap: .9rem; }
  .coop { text-align: left; }
  .coop img { margin-left: 0; height: 60px; }
  .wordmark h1 { font-size: 1.9rem; }
  .review-nav { flex-wrap: wrap; }
  .batch-row { flex-wrap: wrap; }
}
