:root {
  --paper: #fbfaf7;
  --ink: #17160f;
  --muted: #6b675c;
  --line: #e3ded1;
  --accent: #2c4a6b;
  --green: #1c6b45;
  --red: #9b2c1f;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 16px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
}

.top {
  padding: 20px 20px 0;
  max-width: 640px;
  margin: 0 auto;
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  text-decoration: none;
  color: var(--ink);
  font-size: 15px;
  letter-spacing: 0.01em;
}

.wordmark img { display: block; border-radius: 5px; }
.wordmark em { font-style: normal; color: var(--muted); margin-left: 4px; }

main { padding: 0 20px 40px; }

.sheet {
  max-width: 640px;
  margin: 0 auto;
  padding-top: 26px;
}

.kicker {
  margin: 0 0 6px;
  font-size: 13px;
  color: var(--muted);
  letter-spacing: 0.02em;
}

h1 {
  margin: 0 0 10px;
  font-size: 27px;
  line-height: 1.22;
  letter-spacing: -0.01em;
}

h2 { margin: 30px 0 8px; font-size: 16px; }

.lede { margin: 0 0 24px; color: #3a382f; }

p { margin: 0 0 14px; }

.facts {
  margin: 0 0 26px;
  padding: 0;
  border-top: 1px solid var(--line);
}

.facts div {
  display: flex;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
}

.facts dt { width: 108px; flex: none; color: var(--muted); }
.facts dd { margin: 0; }

.narrow { max-width: 420px; }

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
  background: #f1eee6;
  padding: 1px 4px;
  border-radius: 3px;
}

.field { margin: 0 0 20px; }

label {
  display: block;
  margin-bottom: 6px;
  font-size: 14px;
  font-weight: 600;
}

.hint {
  margin: 6px 0 0;
  font-size: 13px;
  color: var(--muted);
  font-weight: 400;
}

input[type="text"], input[type="email"], input[type="tel"], input[type="password"], input:not([type]), textarea {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  font: inherit;
}

input, textarea, button { max-width: 100%; }

input[type="file"] {
  width: 100%;
  padding: 10px;
  border: 1px dashed var(--line);
  border-radius: 6px;
  background: #fff;
  font: inherit;
  font-size: 13px;
  color: var(--muted);
}

input[type="file"]::file-selector-button {
  margin-right: 12px;
  padding: 7px 12px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--paper);
  color: var(--ink);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

textarea { resize: vertical; min-height: 96px; }

input:focus, textarea:focus, button:focus, a:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

[aria-invalid="true"] { border-color: var(--red); }

.error {
  margin: 6px 0 0;
  color: var(--red);
  font-size: 13px;
}

fieldset {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  margin: 0 0 20px;
  min-width: 0; /* a fieldset defaults to min-content and pushes a phone layout sideways */
}

legend { padding: 0 6px; font-size: 14px; font-weight: 600; }

fieldset label { font-weight: 500; font-size: 13px; }
fieldset div + div { margin-top: 12px; }

.consent { margin-top: 4px; }
.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 500; font-size: 14px; }
.check input { margin-top: 3px; }

button {
  display: inline-block;
  width: 100%;
  padding: 13px 18px;
  border: 0;
  border-radius: 6px;
  background: var(--ink);
  color: var(--paper);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

button:hover { background: #000; }

.after { margin-bottom: 24px; }

.notice {
  border-left: 3px solid var(--accent);
  background: #fff;
  padding: 12px 14px;
  margin: 0 0 22px;
  border-radius: 0 6px 6px 0;
}

.notice.bad { border-left-color: var(--red); }
.notice.bad ul { margin: 6px 0 0; padding-left: 18px; }
.notice.ok { border-left-color: var(--green); }
.notice p:last-child { margin-bottom: 0; }

.steps { list-style: none; margin: 0 0 24px; padding: 0; }

.steps li {
  position: relative;
  padding: 0 0 18px 26px;
  color: var(--muted);
  font-size: 14px;
}

.steps li::before {
  content: "";
  position: absolute;
  left: 5px;
  top: 14px;
  bottom: -2px;
  width: 1px;
  background: var(--line);
}

.steps li:last-child::before { display: none; }

.dot {
  position: absolute;
  left: 0;
  top: 6px;
  width: 11px;
  height: 11px;
  border: 1.5px solid var(--line);
  border-radius: 50%;
  background: var(--paper);
}

.steps li.done { color: var(--ink); }
.steps li.done .dot { border-color: var(--green); background: var(--green); }

.link-box {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  padding: 10px 12px;
  overflow-wrap: anywhere;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 13px;
}

.link-box a { color: var(--accent); }

footer {
  max-width: 640px;
  margin: 0 auto;
  padding: 0 20px 40px;
  color: var(--muted);
  font-size: 12px;
}

@media (min-width: 700px) {
  h1 { font-size: 31px; }
  .sheet { padding-top: 34px; }
}

/* The founder's packet: a table somebody reads on a phone at 11pm. */
.sheet.wide { max-width: 860px; }

.actions { display: grid; gap: 10px; margin: 0 0 26px; }
.actions form { margin: 0; }
.actions .secondary { display: flex; gap: 8px; }
.actions .secondary input { flex: 1; }
.actions button { width: auto; min-width: 220px; }
.actions .secondary button { min-width: 92px; background: #fff; color: var(--ink); border: 1px solid var(--line); }
.actions .secondary button:hover { background: var(--paper); }

h3 { margin: 22px 0 6px; font-size: 15px; }

table.evidence { width: 100%; border-collapse: collapse; margin: 0 0 26px; font-size: 14px; }
table.evidence th {
  text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--muted); border-bottom: 1px solid var(--line); padding: 0 8px 6px 0; font-weight: 600;
}
table.evidence td { border-bottom: 1px solid var(--line); padding: 12px 8px 12px 0; vertical-align: top; }
table.evidence td:first-child { width: 34%; }
table.evidence td:nth-child(2) { width: 92px; }

.label { display: block; font-weight: 600; }
.rule { display: block; color: var(--muted); font-size: 12px; margin-top: 4px; }
.tag {
  display: inline-block; margin-top: 6px; padding: 1px 6px; border-radius: 3px; font-size: 11px;
  letter-spacing: 0.04em; text-transform: uppercase; background: #f1eee6; color: var(--muted);
}
.tag.gate { background: #e8eef5; color: #2c4a6b; }
.tag.risk { background: #f5ece8; color: #8a4a34; }

.verdict { font-size: 12px; font-weight: 600; }
.v-strong .verdict { color: var(--green); }
.v-partial .verdict { color: #8a6a1f; }
.v-not_evidenced .verdict { color: var(--muted); }
.v-contradicted .verdict { color: var(--red); }

.claim { margin: 0 0 8px; }
blockquote.quote {
  margin: 0 0 8px; padding: 8px 10px; border-left: 2px solid var(--line); background: #fff;
  font-size: 13px; color: #34322a;
}
blockquote.quote cite { display: block; margin-top: 4px; color: var(--muted); font-size: 11px; font-style: normal; }

details { margin: 18px 0; border-top: 1px solid var(--line); padding-top: 12px; }
summary { cursor: pointer; font-size: 14px; font-weight: 600; }
pre.blind {
  white-space: pre-wrap; overflow-wrap: anywhere; background: #fff; border: 1px solid var(--line);
  border-radius: 6px; padding: 12px; font-size: 12px; line-height: 1.5; color: #34322a;
}

.decisions { margin: 0 0 18px; padding-left: 18px; font-size: 14px; }

@media (min-width: 700px) {
  .actions { grid-template-columns: 260px 1fr; align-items: start; }
}

/* The desk: plain pages a founder can use before the designer turns up. */
.role-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.who { font-size: 13px; color: var(--muted); margin: 0; }
.who a { color: var(--accent); }

.stack { margin: 0 0 22px; }
.inline { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: 0 0 8px; }
.inline input[type="text"], .inline input:not([type]) { flex: 1; min-width: 180px; }
.inline button { width: auto; padding: 9px 14px; font-size: 14px; }

table.table { width: 100%; border-collapse: collapse; margin: 0 0 22px; font-size: 14px; }
table.table th {
  text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted);
  border-bottom: 1px solid var(--line); padding: 0 8px 6px 0; font-weight: 600;
}
table.table td { border-bottom: 1px solid var(--line); padding: 10px 8px 10px 0; vertical-align: top; }
table.table a { color: var(--accent); }
table.criteria td:first-child { width: 46%; }
table.criteria td:nth-child(2) { width: 64px; }
tr.needs { background: #fdf7e9; }

details > form { margin-top: 14px; }

main a, footer a { color: var(--accent); text-underline-offset: 2px; }
.narrow h1 { margin-bottom: 6px; }

.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.92em; }
pre.json {
  background: #f6f4ee; border: 1px solid var(--line); border-radius: 6px; padding: 14px;
  overflow-x: auto; font-size: 12.5px; line-height: 1.5;
}
details.reject { margin: 10px 0 22px; border-top: 1px solid var(--line); padding-top: 12px; }
select { width: 100%; padding: 10px; border: 1px solid var(--line); border-radius: 4px; background: #fff;
         font: inherit; }

/* On a phone the two decision buttons stack. A clipped "Advance" is the one thing that must never happen. */
@media (max-width: 560px) {
  .actions { flex-direction: column; align-items: stretch; }
  .actions form, .actions form.secondary { width: 100%; flex-wrap: wrap; }
  .actions button { width: 100%; }
  .actions .secondary input { width: 100%; flex: 1 1 100%; }
  table.table { font-size: 13px; }
  table.table td, table.table th { padding-right: 6px; }
}

/* A three-column evidence table cannot fit a phone, so on a phone it becomes a list. */
@media (max-width: 560px) {
  table.table, table.evidence,
  table.table thead, table.table tbody, table.table tr, table.table td, table.table th,
  table.evidence thead, table.evidence tbody, table.evidence tr, table.evidence td, table.evidence th {
    display: block;
  }
  table.table thead, table.evidence thead { display: none; }
  table.table tr, table.evidence tr { border-bottom: 1px solid var(--line); padding: 12px 0; }
  table.table td, table.evidence td { border: 0; padding: 0 0 6px; width: auto !important; }
  table.evidence td:first-child, table.evidence td:nth-child(2),
  table.table.criteria td:first-child, table.table.criteria td:nth-child(2) { width: auto; }
  article.sheet { padding-left: 18px; padding-right: 18px; }
}

.connect { margin: 0 0 26px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 6px; background: #fffefb; }
.connect .hint { margin: 0 0 8px; }
a.button {
  display: inline-block; padding: 10px 16px; background: var(--ink); color: var(--paper);
  border-radius: 4px; text-decoration: none; font-size: 14px;
}
