:root {
  --ink: #1b2733;
  --muted: #5b6875;
  --line: #dfe3e8;
  --paper: #fbfaf7;
  --card: #ffffff;
  --accent: #0f5c4d;
  --accent-soft: #e3f0ec;
  --high: #a32a1f;
  --high-soft: #fbe9e7;
  --medium: #8a5a00;
  --medium-soft: #fdf3dc;
  --low: #3f5568;
  --low-soft: #eaf0f5;
  --radius: 8px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
a { color: var(--accent); }
header.top {
  display: flex; align-items: center; gap: 24px; padding: 12px 24px;
  background: var(--ink); color: #fff;
}
header.top a { color: #fff; text-decoration: none; }
header.top .brand { font-weight: 650; letter-spacing: .2px; }
header.top nav { display: flex; gap: 18px; flex: 1; }
header.top form { margin: 0; }
header.top button { background: transparent; color: #cfd8e1; border: 1px solid #44556a; }
main { max-width: 1180px; margin: 0 auto; padding: 24px 16px 64px; }
h1 { font-size: 24px; margin: 0 0 4px; }
h2 { font-size: 18px; margin: 32px 0 12px; }
h3 { font-size: 15px; margin: 20px 0 8px; }
.sub { color: var(--muted); margin: 0 0 16px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.grid { display: grid; gap: 16px; }
.grid.two { grid-template-columns: 1fr 1fr; }
.grid.side { grid-template-columns: 220px 1fr; }
@media (max-width: 800px) { .grid.two, .grid.side { grid-template-columns: 1fr; } }
table { width: 100%; border-collapse: collapse; background: var(--card); }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 12px; text-transform: uppercase; letter-spacing: .4px; color: var(--muted); font-weight: 600; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); }
.table-wrap table { border: 0; }
button, .button {
  font: inherit; font-size: 14px; padding: 6px 12px; border-radius: 6px; cursor: pointer;
  border: 1px solid var(--line); background: #fff; color: var(--ink); text-decoration: none; display: inline-block;
}
button.primary, .button.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
button.danger { color: var(--high); border-color: #e6b9b3; }
button:disabled { opacity: .45; cursor: not-allowed; }
input[type=text], input[type=email], input[type=date], input[type=search], input[type=tel], select, textarea {
  font: inherit; padding: 6px 8px; border: 1px solid #c8cfd6; border-radius: 6px; background: #fff; max-width: 100%;
}
textarea { width: 100%; min-height: 520px; font-family: Georgia, "Times New Roman", serif; font-size: 15px; }
form.inline { display: inline-flex; gap: 6px; align-items: center; margin: 0; flex-wrap: wrap; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.spread { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; flex-wrap: wrap; }
.chip {
  display: inline-block; font-size: 12px; padding: 1px 8px; border-radius: 999px; white-space: nowrap;
  background: var(--low-soft); color: var(--low);
}
.chip.high { background: var(--high-soft); color: var(--high); }
.chip.medium { background: var(--medium-soft); color: var(--medium); }
.chip.ok { background: var(--accent-soft); color: var(--accent); }
.flash { padding: 10px 14px; border-radius: 6px; margin-bottom: 12px; background: var(--accent-soft); }
.flash.error { background: var(--high-soft); color: var(--high); }
.banner { padding: 10px 14px; border-radius: 6px; background: var(--medium-soft); color: var(--medium); margin: 12px 0; }
.banner.danger { background: var(--high-soft); color: var(--high); }
.stats { display: flex; gap: 12px; flex-wrap: wrap; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 14px; min-width: 140px; }
.stat b { display: block; font-size: 22px; }
.issue { border-left: 4px solid var(--line); background: var(--card); border-radius: 0 var(--radius) var(--radius) 0;
  padding: 10px 14px; margin-bottom: 8px; border-top: 1px solid var(--line); border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line); }
.issue.high { border-left-color: var(--high); }
.issue.medium { border-left-color: var(--medium); }
.issue.low { border-left-color: var(--low); }
.issue.closed { opacity: .6; }
.issue details { margin-top: 6px; }
.quote { font-family: Georgia, serif; color: var(--muted); font-size: 13px; }
.letter {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 40px 48px;
  font-family: Georgia, "Times New Roman", serif; font-size: 15.5px; line-height: 1.6; white-space: pre-wrap;
  max-width: 820px;
}
@media (max-width: 700px) { .letter { padding: 20px; } }
.letter .h { display: inline-block; font-family: system-ui, sans-serif; font-size: 15px; margin-top: 4px; }
.ref { font-family: system-ui, sans-serif; font-size: 11px; padding: 0 5px; border-radius: 4px; background: var(--accent-soft);
  color: var(--accent); text-decoration: none; vertical-align: 1px; }
.ref.bad { background: var(--high-soft); color: var(--high); }
mark.gap { background: #ffe9a8; padding: 0 2px; }
mark#hit { background: #ffe066; }
.page-text { white-space: pre-wrap; font-family: Georgia, serif; background: #fff; border: 1px solid var(--line);
  border-radius: var(--radius); padding: 20px; min-height: 300px; }
.pages a { display: block; padding: 4px 8px; border-radius: 6px; text-decoration: none; color: var(--ink); }
.pages a.on { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.mono { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12px; }
.login { max-width: 420px; margin: 80px auto; }
.right { text-align: right; }
details summary { cursor: pointer; }
.findings li { margin-bottom: 8px; }
.mt0 { margin-top: 0; } .mt6 { margin-top: 6px; } .mt8 { margin-top: 8px; } .mt12 { margin-top: 12px; }
.mt16 { margin-top: 16px; } .mt24 { margin-top: 24px; } .mb8 { margin-bottom: 8px; } .mb12 { margin-bottom: 12px; }
.nowrap { white-space: nowrap; } .err { color: var(--high); } .big { font-size: 18px; } .full { width: 100%; }
.grid.draft-layout { grid-template-columns: minmax(0, 1fr) 320px; align-items: start; }
@media (max-width: 900px) { .grid.draft-layout { grid-template-columns: 1fr; } }
.card.danger-card { border-left: 4px solid var(--high); }
.deadline-alerts { margin-bottom: 18px; }
tr.inference td { background: var(--high-soft); }
