/* --- Base --- */
:root {
  --ok: #0a6a0a;
  --fail: #a12020;
  --pending: #888;
  --muted: #666;
  --border: #ccc;
  --bg-alt: #f6f6f6;
  --bg-row: #fbfbfb;
  --accent: #345;
}
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  margin: 2em;
  color: #222;
  max-width: 1400px;
  line-height: 1.45;
}
h1 { font-size: 1.5em; margin-bottom: 0.2em; }
h2 {
  font-size: 1.15em;
  margin-top: 1.6em;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.2em;
}
h3 { font-size: 1em; margin-top: 1.4em; }
p.subtitle { color: var(--muted); }
nav.breadcrumb {
  margin: 0.2em 0 1em 0;
  font-size: 0.9em;
  color: var(--muted);
}
nav.breadcrumb a { color: var(--accent); text-decoration: none; }
nav.breadcrumb a:hover { text-decoration: underline; }
code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.92em;
}
pre {
  background: var(--bg-alt);
  border: 1px solid #eee;
  padding: 0.8em 1em;
  overflow-x: auto;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.85em;
  line-height: 1.4;
  border-radius: 4px;
}
.verdict-ok { color: var(--ok); font-weight: 600; text-decoration: none; }
.verdict-fail { color: var(--fail); font-weight: 600; text-decoration: none; }
.verdict-missing { color: var(--pending); }
.verdict-pending { color: var(--pending); font-weight: 600; }
.verdict-ok:hover, .verdict-fail:hover { text-decoration: underline; }

/* --- Landing --- */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1em;
  margin: 1em 0 2em 0;
}
.card {
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.9em 1em;
  background: #fff;
}
.card h3 { margin: 0 0 0.4em 0; font-size: 1em; }
.card .metric {
  font-size: 1.6em;
  font-weight: 600;
  color: var(--accent);
}
.card .metric small { font-weight: 400; color: var(--muted); font-size: 0.5em; }

/* --- Matrix --- */
nav.toc {
  margin: 0.8em 0 1.4em 0;
  padding: 0.5em 0.8em;
  background: var(--bg-alt);
  border: 1px solid #ddd;
  border-radius: 4px;
}
nav.toc a { color: var(--accent); margin: 0 0.2em; text-decoration: none; }
nav.toc a:hover { text-decoration: underline; }
.filter-bar { margin: 0.8em 0; }
.filter-bar input {
  padding: 0.4em 0.6em;
  width: 24em;
  max-width: 100%;
  font-size: 1em;
  border: 1px solid #bbb;
  border-radius: 4px;
}
section.format-section { margin-bottom: 2em; }
details.category { margin: 0.4em 0 0.8em 0; }
details.category > summary {
  cursor: pointer;
  padding: 0.3em 0.2em;
  font-weight: 600;
}
details.category[data-empty="true"] { display: none; }
table.matrix {
  border-collapse: collapse;
  margin: 0.4em 0 0.8em 0;
  width: 100%;
}
table.matrix th, table.matrix td {
  border: 1px solid var(--border);
  padding: 0.45em 0.75em;
  text-align: left;
  vertical-align: top;
}
table.matrix th { background: var(--bg-alt); }
table.matrix td.missing { color: var(--pending); text-align: center; }
table.matrix tr[hidden] { display: none; }
tr.family-parent { background: var(--bg-row); }
tr.family-parent .family-count {
  color: var(--pending);
  font-size: 0.9em;
  font-weight: normal;
}

td.aggregate { font-size: 0.95em; }
td.aggregate .verdict-ok, td.aggregate .verdict-fail { margin: 0 0.15em; }

/* --- Case / Family detail --- */
.detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
  gap: 1.6em;
  margin-top: 1em;
}
@media (max-width: 980px) {
  .detail-grid { grid-template-columns: 1fr; }
}
.detail-main > section, .detail-side > section { margin-bottom: 1.6em; }
.kv-table { border-collapse: collapse; width: 100%; margin: 0.4em 0; }
.kv-table th, .kv-table td {
  border: 1px solid var(--border);
  padding: 0.35em 0.6em;
  text-align: left;
  vertical-align: top;
  font-size: 0.92em;
}
.kv-table th { background: var(--bg-alt); width: 10em; }
.assertion-table th, .assertion-table td {
  border: 1px solid var(--border);
  padding: 0.4em 0.6em;
  vertical-align: top;
  font-size: 0.9em;
}
.assertion-table { border-collapse: collapse; width: 100%; }
.assertion-table th { background: var(--bg-alt); text-align: left; }
.assertion-table td.xpath { font-family: ui-monospace, monospace; font-size: 0.85em; white-space: pre-wrap; word-break: break-word; }
.download-button {
  display: inline-block;
  padding: 0.4em 0.9em;
  background: var(--accent);
  color: #fff;
  border-radius: 4px;
  text-decoration: none;
  font-size: 0.9em;
  margin-right: 0.5em;
  margin-bottom: 0.4em;
}
.download-button:hover { background: #234; }
.download-button.secondary { background: #678; }
.preview-frame {
  width: 100%;
  max-width: 720px;
  height: 720px;
  border: 1px solid var(--border);
  background: #fafafa;
}
.preview-png {
  width: 100%;
  max-width: 720px;
  border: 1px solid var(--border);
  background: #fafafa;
}
.notes {
  background: #fff9e8;
  border: 1px solid #efd58b;
  border-radius: 4px;
  padding: 0.6em 0.9em;
  font-size: 0.9em;
  white-space: pre-wrap;
}
.library-chip {
  display: inline-block;
  padding: 0.15em 0.55em;
  margin-right: 0.3em;
  border-radius: 10px;
  font-size: 0.85em;
  background: var(--bg-alt);
  border: 1px solid #ddd;
  text-decoration: none;
  color: var(--accent);
}
.library-chip.verdict-ok { border-color: #b6dbb6; background: #ecf7ec; }
.library-chip.verdict-fail { border-color: #e5b5b5; background: #faeaea; }
.library-chip.verdict-missing { color: var(--pending); }
p.empty { color: var(--pending); font-style: italic; }
.child-case-list {
  columns: 2;
  column-gap: 1.2em;
  margin-top: 0.5em;
  padding-left: 1.2em;
}
.child-case-list li { break-inside: avoid; font-size: 0.92em; }
@media (max-width: 720px) { .child-case-list { columns: 1; } }
footer.site-footer {
  margin-top: 3em;
  padding-top: 1em;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.85em;
}
