:root {
  --paper: #fbf8f1;
  --ink: #1f1d1a;
  --dim: #6f6a60;
  --rule: #e3dccd;
  --card: #fffdf8;
  --accent: #8a2b1f;
  --accent-2: #2c4a6e;
  --ok: #2f6b3a;
  --bad: #a33a2a;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}
* { box-sizing: border-box; }
html { background: var(--paper); }
body { margin: 0; color: var(--ink); font: 17px/1.55 var(--serif); }
a { color: var(--accent-2); text-decoration: none; }
a:hover { text-decoration: underline; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 20px; }
.dim { color: var(--dim); }
.small { font-size: .88em; }
.nowrap { white-space: nowrap; }
.ok { color: var(--ok); font-weight: 600; }
.bad { color: var(--bad); font-weight: 600; }
code { font: .86em var(--mono); background: #f1ebdd; padding: 1px 5px; border-radius: 3px; word-break: break-all; }
h1 { font-size: 1.75em; line-height: 1.25; margin: .6em 0 .3em; font-weight: 600; }
h2 { font-size: 1.1em; margin: 0 0 .6em; font-family: var(--sans); letter-spacing: .01em; }
h3 { font: 600 .8em var(--sans); text-transform: uppercase; letter-spacing: .08em; color: var(--dim); margin: 1.6em 0 .4em; }

/* header */
header.top { border-bottom: 1px solid var(--rule); background: var(--card); }
.bar { display: flex; align-items: center; gap: 24px; min-height: 58px; flex-wrap: wrap; }
.brand { font-size: 1.25em; color: var(--ink); font-weight: 600; white-space: nowrap; }
.brand em { color: var(--accent); font-style: italic; font-weight: 500; }
.brand .mark { color: var(--accent); }
nav { display: flex; gap: 18px; font-family: var(--sans); font-size: .9em; flex-wrap: wrap; }
nav a { color: var(--ink); }
.who { margin-left: auto; display: flex; align-items: center; gap: 10px; font: .9em var(--sans); }
.who .me { display: flex; align-items: center; gap: 6px; color: var(--ink); }
.who img, .avatar { width: 26px; height: 26px; border-radius: 50%; vertical-align: middle; }
.avatar { width: 44px; height: 44px; }
footer { color: var(--dim); font: .82em var(--sans); padding: 40px 20px 50px; border-top: 1px solid var(--rule); margin-top: 50px; }

/* buttons & forms */
button, .btn { font: 500 .9em var(--sans); background: var(--ink); color: #fff; border: 0; border-radius: 6px; padding: 8px 14px; cursor: pointer; display: inline-block; }
button:hover, .btn:hover { background: #000; text-decoration: none; }
.btn.small, button.small { padding: 5px 10px; font-size: .82em; }
button.good { background: var(--ok); }
button.warnbtn { background: var(--bad); }
button.link { background: none; color: var(--accent-2); padding: 0; font-weight: 400; }
button.link:hover { text-decoration: underline; background: none; }
form.inline { display: inline; }
input, select, textarea { font: 15px var(--sans); padding: 7px 9px; border: 1px solid #cfc6b3; border-radius: 6px; background: #fff; color: var(--ink); max-width: 100%; }
textarea { width: 100%; font: 15px/1.45 var(--mono); }
.stack { display: flex; flex-direction: column; gap: 10px; margin-top: 12px; }
.stack label { display: flex; flex-direction: column; gap: 4px; font: 600 .82em var(--sans); color: var(--dim); }
.stack label input, .stack label select, .stack label textarea { font-weight: 400; color: var(--ink); }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; }
.row label { flex: 1; min-width: 90px; }
.stack > button, .stack > div > button { align-self: flex-start; }

/* intro */
.intro { margin: 28px 0 10px; max-width: 820px; }
.intro p { font-size: 1.12em; margin: 0 0 16px; }
.flow { list-style: none; padding: 0; margin: 0; display: flex; gap: 8px; flex-wrap: wrap; font: .88em var(--sans); }
.flow li { background: var(--card); border: 1px solid var(--rule); border-radius: 20px; padding: 5px 14px 5px 6px; }
.flow span { display: inline-block; width: 22px; height: 22px; line-height: 22px; text-align: center; border-radius: 50%; background: var(--accent); color: #fff; margin-right: 6px; font-weight: 600; font-size: .85em; }

/* filters & table */
.filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin: 26px 0 10px; }
.filters input[type=search] { flex: 1; min-width: 200px; }
.counts { font: .85em var(--sans); color: var(--dim); margin: 6px 0 12px; display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
table.reports { width: 100%; border-collapse: collapse; background: var(--card); border: 1px solid var(--rule); border-radius: 8px; overflow: hidden; font-size: .95em; }
.reports th { font: 600 .72em var(--sans); text-transform: uppercase; letter-spacing: .06em; color: var(--dim); text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--rule); background: #f6f1e5; }
.reports td { padding: 8px 10px; border-bottom: 1px solid #efe9dc; vertical-align: top; }
.reports tr:last-child td { border-bottom: 0; }
.reports td.num { font-family: var(--sans); font-size: .88em; white-space: nowrap; }
.reports td.book { font: .82em var(--sans); white-space: nowrap; color: var(--dim); }
.reports td.title a { color: var(--ink); }
.empty { text-align: center; color: var(--dim); padding: 30px !important; }
.pager { display: flex; justify-content: space-between; margin: 14px 0; font-family: var(--sans); }

/* badges */
.badge { display: inline-block; font: 600 .72em var(--sans); padding: 2px 8px; border-radius: 10px; letter-spacing: .02em; background: #ece5d6; color: #4a4539; white-space: nowrap; }
a.badge:hover { text-decoration: none; filter: brightness(.95); }
.s-open { background: #e6edf6; color: #2c4a6e; }
.s-needs-info { background: #f8ecd2; color: #7a5410; }
.s-confirmed { background: #dcefdc; color: #255c2f; }
.s-duplicate { background: #ece9e3; color: #6f6a60; }
.s-known { background: #ece9e3; color: #5b5a50; }
.s-invalid { background: #f3dedb; color: #8a2b1f; }
.s-sent { background: #e7e0f3; color: #4d3483; }
.s-accepted { background: #2f6b3a; color: #fff; }
.s-rejected { background: #a33a2a; color: #fff; }
.b-open { background: #e6edf6; color: #2c4a6e; }
.b-sent { background: #e7e0f3; color: #4d3483; }
.b-answered { background: #2f6b3a; color: #fff; }
.b-abandoned { background: #ece9e3; color: #6f6a60; }
.kind { font: .72em var(--sans); color: var(--dim); border: 1px solid var(--rule); border-radius: 4px; padding: 0 5px; white-space: nowrap; }
.via { font: 600 .66em var(--sans); color: #6b4fa3; background: #efe9f8; border-radius: 4px; padding: 1px 5px; text-transform: uppercase; letter-spacing: .05em; }

/* report */
.crumbs { font: .85em var(--sans); margin-top: 26px; }
.report h1 { margin-top: .2em; }
.meta { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; font: .88em var(--sans); color: var(--dim); }
.meta b { color: var(--ink); }
.text { white-space: pre-wrap; background: var(--card); border: 1px solid var(--rule); border-radius: 8px; padding: 14px 16px; overflow-wrap: anywhere; }
.howfound { font: .88em var(--sans); color: var(--dim); }
.notice { background: #eef3f9; border: 1px solid #cfdbea; border-radius: 8px; padding: 10px 14px; font-family: var(--sans); font-size: .92em; }
.warn { background: #fbefe0; border: 1px solid #ecd1a8; border-radius: 8px; padding: 10px 14px; font-family: var(--sans); font-size: .92em; }
.cols { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 24px; margin-top: 26px; }
@media (max-width: 860px) { .cols { grid-template-columns: 1fr; } }
.box { background: var(--card); border: 1px solid var(--rule); border-radius: 10px; padding: 16px 18px; margin-bottom: 18px; }
.box.narrow { max-width: 640px; }
.side .box { font-size: .95em; }
.verdict { padding: 6px 0; border-bottom: 1px dashed var(--rule); font-size: .95em; }
.verdict.v-confirm b::before { content: "✓ "; color: var(--ok); }
.verdict.v-dispute b::before { content: "✗ "; color: var(--bad); }
.comment { margin-bottom: 14px; }
.comment .text { padding: 10px 14px; font-size: .95em; }
.comment.hiddenc { opacity: .45; }
.chead { font: .85em var(--sans); margin-bottom: 4px; }
ul.plain { list-style: none; padding: 0; margin: 0; }
ul.plain li { padding: 5px 0; border-bottom: 1px dashed var(--rule); }
ul.plain li:last-child { border: 0; }
.excerpt { font-size: .88em; color: var(--dim); white-space: pre-wrap; max-height: 4.5em; overflow: hidden; }
ul.history { list-style: none; padding: 0; margin: 0; font: .85em var(--sans); }
ul.history li { padding: 4px 0; }
ul.history.big li { padding: 7px 0; border-bottom: 1px solid #efe9dc; font-size: 1.05em; }
details summary { cursor: pointer; list-style: none; }
details summary h2 { display: inline; }
details summary::before { content: "▸ "; color: var(--dim); }
details[open] summary::before { content: "▾ "; }
.curate form { border-top: 1px dashed var(--rule); padding-top: 12px; }
.curate form:first-of-type { border-top: 0; padding-top: 0; }

/* submit */
.checklist { background: var(--card); border: 1px solid var(--rule); border-left: 4px solid var(--accent); border-radius: 8px; padding: 10px 16px; font: .92em var(--sans); max-width: 820px; }
.checklist ol { margin: 6px 0 0; padding-left: 20px; }
.report-form { max-width: 820px; }
.similar ul { margin-top: 8px; }

/* batches */
pre.letter { white-space: pre-wrap; font: 14px/1.5 var(--mono); background: #fff; border: 1px solid var(--rule); padding: 18px; border-radius: 6px; max-height: 520px; overflow: auto; }

/* guide */
.guide { max-width: 800px; }
.guide h2 { margin-top: 1.8em; font-size: 1.2em; }
dl.statuses { display: grid; grid-template-columns: max-content 1fr; gap: 6px 14px; align-items: baseline; }
dl.statuses dd { margin: 0; }
.consent h1 { font-size: 1.4em; margin-top: 0; }
.token { font-size: .95em; }

/* agents / MCP setup page */
nav a.navmcp { font-weight: 600; color: var(--accent); }
.endpoint { background: var(--card); border: 1px solid var(--rule); border-left: 4px solid var(--accent); border-radius: 8px; padding: 12px 16px; margin: 18px 0 22px; }
.endpoint .row { align-items: center; margin-top: 4px; }
code.big { font-size: 1.05em; padding: 4px 8px; }
.cmd { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: 8px 0; }
.cmd code { padding: 6px 8px; }
pre.snippet { font: 13px/1.5 var(--mono); background: #fff; border: 1px solid var(--rule); border-radius: 6px; padding: 12px 14px; overflow-x: auto; }
.agents .box ol { margin: 0; padding-left: 20px; }
