:root {
  --paper: #ffffff;
  --wash: #f7f8fa;
  --line: #e3e6ea;
  --line-strong: #cfd4da;
  --ink: #12151a;
  --body: #414852;
  --muted: #77808c;
  --blue: #1d4ed8;
  --blue-soft: #eef2ff;
  --red: #b42318;
  --red-soft: #fef3f2;
  --amber: #8a5a00;
  --amber-soft: #fffaeb;
  --green: #087443;
  --green-soft: #ecfdf3;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.shell { max-width: 1080px; margin: 0 auto; padding: 40px 28px 72px; }

/* ---------------------------------------------------------------- header */
.masthead { display: flex; justify-content: space-between; align-items: flex-start; gap: 24px; padding-bottom: 22px; border-bottom: 1px solid var(--line); }
.masthead h1 { font-size: 21px; font-weight: 600; letter-spacing: -0.015em; }
.masthead .subtitle { margin-top: 6px; color: var(--muted); font-size: 13px; }
.pin { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; text-align: right; }
.pin code { font-family: var(--mono); font-size: 11px; color: var(--body); }
.pin .pin-label { font-size: 10px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }

/* --------------------------------------------------------------- summary */
.summary { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 8px; overflow: hidden; margin: 26px 0 8px; }
.stat { background: var(--paper); padding: 16px 16px 14px; }
.stat dt { font-size: 11px; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); }
.stat dd { margin-top: 4px; font-family: var(--mono); font-size: 22px; font-weight: 600; letter-spacing: -0.02em; }
.stat dd.crit { color: var(--red); }
.stat dd.ok { color: var(--green); }
.stat .footnote { margin-top: 2px; font-size: 11px; color: var(--muted); }

.disclaimer { font-size: 12.5px; color: var(--muted); margin-bottom: 26px; }
.disclaimer strong { color: var(--body); font-weight: 600; }

/* ------------------------------------------------------------------ tabs */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 0; }
.tab { appearance: none; background: none; border: 0; border-bottom: 2px solid transparent; padding: 10px 14px; font: inherit; font-size: 13px; color: var(--muted); cursor: pointer; }
.tab[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--blue); font-weight: 600; }
.tab .count { font-family: var(--mono); font-size: 11px; color: var(--muted); margin-left: 6px; }

.panel { padding-top: 22px; }
.panel[hidden] { display: none; }

/* ---------------------------------------------------------------- journey */
.journey { width: 100%; border-collapse: collapse; }
.journey th { text-align: left; font-size: 10.5px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); font-weight: 500; padding: 0 10px 8px; border-bottom: 1px solid var(--line); }
.journey th:first-child { padding-left: 0; }
.journey td { padding: 13px 10px; border-bottom: 1px solid var(--line); vertical-align: top; font-size: 13.5px; }
.journey td:first-child { padding-left: 0; width: 34px; color: var(--muted); font-family: var(--mono); font-size: 12px; }
.journey tr.row { cursor: pointer; }
.journey tr.row:hover td { background: var(--wash); }
.journey tr.row:focus-visible { outline: 2px solid var(--blue); outline-offset: -2px; }
.journey .title { font-weight: 550; color: var(--ink); }
.journey .question { display: block; margin-top: 2px; color: var(--muted); font-size: 12.5px; }
.journey .step-name { font-size: 12px; color: var(--body); }

.chip { display: inline-block; font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.03em; padding: 2px 7px; border-radius: 3px; border: 1px solid transparent; white-space: nowrap; }
.chip-gap { background: var(--amber-soft); color: var(--amber); border-color: #f2e0b8; }
.chip-critical { background: var(--red-soft); color: var(--red); border-color: #f4cdc8; }
.chip-resolved { background: var(--green-soft); color: var(--green); border-color: #c3e9d6; }
.chip-unverified { background: var(--wash); color: var(--muted); border-color: var(--line-strong); }
.chip-none { color: var(--muted); }

/* ------------------------------------------------------------------ detail */
.detail { border: 1px solid var(--line); border-radius: 8px; padding: 20px; margin-bottom: 14px; background: var(--paper); }
.detail:target { border-color: var(--blue); }
.detail h3 { font-size: 15px; font-weight: 600; margin-bottom: 2px; }
.detail .meta { font-size: 11.5px; color: var(--muted); font-family: var(--mono); margin-bottom: 14px; }
.field { margin-bottom: 14px; }
.field dt { font-size: 10.5px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); margin-bottom: 4px; }
.field dd { font-size: 13.5px; color: var(--body); }
.field dd.rec { border-left: 2px solid var(--blue); padding-left: 12px; }

.evidence { list-style: none; display: flex; flex-direction: column; gap: 10px; }
.evidence li { font-size: 12.5px; }
.evidence a { color: var(--blue); text-decoration: none; font-family: var(--mono); font-size: 12px; border-bottom: 1px solid transparent; }
.evidence a:hover { border-bottom-color: var(--blue); }
.evidence .note { color: var(--muted); font-size: 11.5px; margin-left: 6px; }
.evidence blockquote { margin-top: 5px; padding: 8px 12px; background: var(--wash); border-radius: 4px; font-family: var(--mono); font-size: 11.5px; color: var(--body); line-height: 1.55; word-break: break-word; white-space: pre-wrap; }
.mcp-call-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.mcp-list { padding-left: 18px; display: flex; flex-direction: column; gap: 6px; font-size: 13.5px; color: var(--body); }

.actions { display: flex; gap: 10px; margin-bottom: 18px; }
.btn { appearance: none; font: inherit; font-size: 12.5px; padding: 7px 12px; border-radius: 5px; border: 1px solid var(--line-strong); background: var(--paper); color: var(--ink); cursor: pointer; }
.btn:hover { border-color: var(--body); }
.btn-primary { background: var(--blue); border-color: var(--blue); color: #fff; }
.btn-primary:hover { background: #1740b0; border-color: #1740b0; }

/* ------------------------------------------------------------------ search */
.search-row { display: flex; gap: 8px; margin-bottom: 8px; }
.search-row input { flex: 1; font: inherit; font-size: 13.5px; padding: 9px 12px; border: 1px solid var(--line-strong); border-radius: 5px; background: var(--paper); color: var(--ink); }
.search-row input:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-soft); }
.hint { font-size: 12px; color: var(--muted); margin-bottom: 18px; }

.result { padding: 13px 0; border-bottom: 1px solid var(--line); }
.result .result-head { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; }
.result a { color: var(--blue); text-decoration: none; font-size: 13.5px; font-weight: 550; }
.result a:hover { text-decoration: underline; }
.result .result-id { font-family: var(--mono); font-size: 11px; color: var(--muted); }
.result .result-id .occ { color: var(--body); }
.result blockquote { margin-top: 6px; padding: 8px 12px; background: var(--wash); border-radius: 4px; font-family: var(--mono); font-size: 11.5px; color: var(--body); line-height: 1.55; }

/* ------------------------------------------------------------------- notes */
.notice { border: 1px solid var(--line); border-left-width: 3px; border-radius: 5px; padding: 12px 14px; font-size: 13px; margin: 16px 0; }
.notice-error { border-left-color: var(--red); background: var(--red-soft); color: #7a1a12; }
.notice-info { border-left-color: var(--blue); background: var(--blue-soft); color: #1a2d6b; }
.notice strong { font-weight: 600; }

.empty { padding: 28px 0; color: var(--muted); font-size: 13.5px; }

.rubric { margin-top: 30px; border-top: 1px solid var(--line); padding-top: 18px; }
.rubric h2 { font-size: 13px; font-weight: 600; margin-bottom: 10px; }
.rubric dl { display: grid; grid-template-columns: 92px 1fr; gap: 8px 14px; font-size: 12.5px; }
.rubric dt { font-family: var(--mono); font-size: 11px; color: var(--body); }
.rubric dd { color: var(--muted); }

footer { margin-top: 40px; padding-top: 18px; border-top: 1px solid var(--line); font-size: 12px; color: var(--muted); display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
footer a { color: var(--body); }

@media (max-width: 760px) {
  .shell { padding: 26px 18px 56px; }
  .masthead { flex-direction: column; gap: 14px; }
  .pin { align-items: flex-start; text-align: left; }
  .summary { grid-template-columns: repeat(2, 1fr); }
  .journey th:nth-child(2), .journey td:nth-child(2) { display: none; }
}
