:root {
  --paper: #f4efe6;
  --ink: #1a2420;
  --muted: #5c6b63;
  --line: #e3d8c8;
  --moss: #1f6b45;
  --moss-deep: #164d32;
  --sure: #e7f6ee;
  --unsure: #fff6d8;
  --card: #fffdf8;
  --soft: #f7f3eb;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background:
    radial-gradient(900px 280px at 50% -40px, #e5f3eb, transparent 70%),
    var(--paper);
  color: var(--ink);
  font: 16px/1.5 "Segoe UI", system-ui, sans-serif;
}

a { color: var(--moss-deep); }

.wrap { max-width: 840px; margin: 0 auto; padding: 28px 20px 72px; }

header.site {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 32px;
  padding: 12px 14px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  position: sticky;
  top: 12px;
  z-index: 2;
}

header.site a.brand {
  color: inherit;
  text-decoration: none;
  font-weight: 700;
  letter-spacing: -0.03em;
  font-size: 18px;
}

header.site a.brand::before {
  content: "";
  display: inline-block;
  width: 10px;
  height: 10px;
  margin-right: 8px;
  border-radius: 50%;
  background: var(--moss);
  box-shadow: 0 0 0 4px #e5f3eb;
}

header.site nav { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }

header.site nav a {
  color: var(--ink);
  text-decoration: none;
  font-size: 14px;
  padding: 6px 10px;
  border-radius: 999px;
}

header.site nav a:hover { background: var(--soft); }
header.site nav a.here { background: #e5f3eb; color: var(--moss-deep); font-weight: 650; }
header.site nav a.run-local {
  color: var(--moss-deep);
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
  border-radius: 0;
  margin-left: 6px;
}
header.site nav a.run-local:hover { background: transparent; }

h1 { font-size: 40px; line-height: 1.12; letter-spacing: -0.035em; margin: 0 0 10px; }
h2 { font-size: 18px; margin: 0 0 8px; color: var(--ink); font-weight: 700; letter-spacing: -0.02em; }
.lede { font-size: 18px; margin: 0 0 8px; max-width: 38em; color: #24312b; }

a.run-local {
  font-weight: 700;
  text-underline-offset: 3px;
}

.steps {
  list-style: none;
  padding: 0;
  margin: 0 0 22px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.steps li {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 16px;
}

.steps b { display: block; margin-bottom: 4px; }
.steps span { display: block; color: var(--muted); font-size: 14px; }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 22px;
  margin: 18px 0;
}

.forms { display: grid; gap: 10px; }

.forms a {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--card);
  text-decoration: none;
  color: inherit;
}

.forms a:hover { border-color: #8fbfa4; background: #fbfffc; }
.forms a b { font-size: 16px; }
.forms a span { color: var(--muted); font-size: 14px; }

form {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 22px;
  margin: 18px 0;
}

form .grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 16px; }
form .span-2 { grid-column: 1 / -1; }

@media (max-width: 720px) {
  h1 { font-size: 32px; }
  header.site { position: static; flex-direction: column; align-items: flex-start; }
  header.site nav a.run-local { margin-left: 0; }
  .steps { grid-template-columns: 1fr; }
  form .grid { grid-template-columns: 1fr; }
  form .span-2 { grid-column: auto; }
}

.field { display: flex; flex-direction: column; gap: 6px; }
.field label, .field legend, .label { font-size: 13px; font-weight: 650; }

fieldset {
  border: 1px solid var(--line);
  border-radius: 12px;
  margin: 0;
  padding: 12px;
  background: var(--soft);
}

fieldset label { font-weight: 450; margin-right: 14px; }

input, select, textarea {
  font: inherit;
  color: inherit;
  background: white;
  border: 1px solid #d9d0c2;
  border-radius: 10px;
  padding: 10px 12px;
  width: 100%;
}

input:focus, select:focus, textarea:focus {
  outline: 3px solid #d7ebdf;
  border-color: var(--moss);
}

input[type="file"] {
  padding: 12px;
  background: var(--soft);
  border-style: dashed;
}

input[type="checkbox"], input[type="radio"] { width: auto; }

.actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 18px; }

button {
  font: inherit;
  border: 0;
  border-radius: 10px;
  padding: 10px 16px;
  cursor: pointer;
}

button:disabled { opacity: 0.55; cursor: default; }
button:focus-visible, a:focus-visible { outline: 3px solid #d7ebdf; outline-offset: 2px; }

#slothfill, #read, #sample, #save, #list, #read-folder {
  background: var(--moss);
  color: white;
}

#slothfill:hover, #read:hover, #sample:hover, #save:hover, #list:hover, #read-folder:hover {
  background: var(--moss-deep);
}

button[type="submit"] {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--line);
}

#read, #save, #list { background: var(--moss); color: white; border: 0; }

.actions a {
  font-size: 14px;
  font-weight: 700;
  text-underline-offset: 3px;
}

.status { min-height: 3em; color: var(--muted); margin-bottom: 0; }

.pdf-list { list-style: none; padding: 0; margin: 14px 0 0; }
.pdf-list li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
}

.scan {
  margin-top: 16px;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--soft);
}

.scan-label { font-weight: 700; min-height: 1.5em; }

progress {
  width: 100%;
  height: 10px;
  margin-top: 8px;
  border: 0;
  border-radius: 999px;
  overflow: hidden;
  accent-color: var(--moss);
}

.field.is-sure input, .field.is-sure select, .field.is-sure textarea,
[role="listitem"].is-sure input {
  background: var(--sure);
  outline: 2px solid var(--moss);
}

.field.is-unsure input, .field.is-unsure select, .field.is-unsure textarea,
[role="listitem"].is-unsure input {
  background: var(--unsure);
  outline: 2px solid #a88416;
}

fieldset.is-sure { box-shadow: inset 3px 0 0 var(--moss); background: var(--sure); }
fieldset.is-unsure { box-shadow: inset 3px 0 0 #a88416; background: var(--unsure); }

.note { font-size: 14px; color: var(--muted); }
code { font-family: Consolas, monospace; font-size: 0.92em; background: var(--soft); padding: 1px 6px; border-radius: 6px; }

footer.site-foot {
  margin-top: 8px;
  padding-top: 16px;
  color: var(--muted);
  font-size: 14px;
}
