
:root {
  --bg: #ffffff;
  --fg: #1d2330;
  --muted: #5f6b7a;
  --line: #e3e7ee;
  --soft: #f5f7fa;
  --accent: #1a56db;
  --accent-soft: #e8efff;
  --mark: #fff1a8;
  --ok: #157f3b;
  --warn: #9a6700;
  --bad: #b42318;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #11151c;
    --fg: #e6e9ef;
    --muted: #9aa5b4;
    --line: #2a313c;
    --soft: #181e27;
    --accent: #7aa2ff;
    --accent-soft: #1d2a45;
    --mark: #5c4a00;
    --ok: #4ac26b;
    --warn: #e3b341;
    --bad: #ff7b72;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--fg); font: 16px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
main { max-width: 1120px; margin: 0 auto; padding: 24px 16px 64px; }
h1 { font-size: 1.75rem; line-height: 1.25; margin: 8px 0 12px; }
h2 { font-size: 1.2rem; margin: 32px 0 12px; }
h3 { font-size: 1.05rem; margin: 0 0 8px; }
.top { display: flex; align-items: center; gap: 16px; padding: 12px 16px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.top nav { margin-left: auto; }
.brand { font-weight: 700; color: var(--fg); white-space: nowrap; }
.brand span { font-weight: 400; color: var(--muted); }
.search { display: flex; gap: 8px; max-width: 760px; width: 100%; }
.search.compact { max-width: 520px; flex: 1 1 280px; }
.search input { flex: 1; min-width: 0; padding: 12px 16px; font-size: 1rem; border: 1px solid var(--line); border-radius: 24px; background: var(--bg); color: var(--fg); }
.search.compact input { padding: 8px 14px; }
.search input:focus { outline: 2px solid var(--accent); border-color: transparent; }
.search button { padding: 0 20px; border: 0; border-radius: 24px; background: var(--accent); color: #fff; font-size: 0.95rem; cursor: pointer; }
.hero { text-align: center; padding: 48px 0 24px; }
.hero h1 { font-size: 2.1rem; }
.hero p { color: var(--muted); margin: 0 auto 24px; max-width: 680px; }
.hero .search { margin: 0 auto; }
.grid { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.grid a { display: flex; flex-direction: column; padding: 14px 16px; border: 1px solid var(--line); border-radius: 10px; color: var(--fg); height: 100%; }
.grid a:hover { border-color: var(--accent); text-decoration: none; }
.grid span { color: var(--muted); font-size: 0.9rem; }
.datasets, .hits { list-style: none; padding: 0; margin: 0; }
.datasets > li { padding: 14px 0; border-bottom: 1px solid var(--line); }
.datasets .title, .hits .title { font-size: 1.05rem; font-weight: 600; }
.meta { color: var(--muted); font-size: 0.88rem; display: flex; gap: 14px; flex-wrap: wrap; margin-top: 2px; }
.datasets p { margin: 6px 0 0; color: var(--fg); font-size: 0.95rem; }
.group { border: 1px solid var(--line); border-radius: 12px; padding: 16px; margin: 0 0 16px; }
.group h3 { display: flex; gap: 12px; align-items: baseline; flex-wrap: wrap; }
.count { color: var(--muted); font-weight: 400; font-size: 0.9rem; }
.hits > li { padding: 10px 0; border-top: 1px solid var(--line); }
.snippet { margin: 6px 0 0; display: grid; grid-template-columns: minmax(120px, 220px) 1fr; gap: 2px 12px; font-size: 0.9rem; }
.snippet div { display: contents; }
.snippet dt { color: var(--muted); overflow-wrap: anywhere; }
.snippet dd { margin: 0; overflow-wrap: anywhere; }
mark { background: var(--mark); color: inherit; padding: 0 1px; border-radius: 2px; }
.more { display: inline-block; margin-top: 8px; font-size: 0.92rem; }
.note { color: var(--muted); background: var(--soft); border-radius: 8px; padding: 12px 16px; }
.scope { color: var(--muted); }
.crumbs { color: var(--muted); font-size: 0.9rem; margin-bottom: 4px; }
.lead { color: var(--muted); }
.facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; margin: 16px 0 20px; }
.facts div { background: var(--soft); border-radius: 10px; padding: 10px 14px; }
.facts dt { color: var(--muted); font-size: 0.82rem; }
.facts dd { margin: 2px 0 0; font-weight: 600; overflow-wrap: anywhere; }
.notes p { margin: 0 0 10px; white-space: pre-line; }
.tags { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.tags a { display: inline-block; padding: 2px 10px; background: var(--accent-soft); border-radius: 12px; font-size: 0.88rem; }
table { border-collapse: collapse; width: 100%; font-size: 0.92rem; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 600; }
.files .sub { color: var(--muted); font-size: 0.85rem; }
.files tr.selected td { background: var(--accent-soft); }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 10px; }
.rows th, .rows td { white-space: nowrap; max-width: 320px; overflow: hidden; text-overflow: ellipsis; }
.fields th { width: 32%; overflow-wrap: anywhere; }
.fields td { overflow-wrap: anywhere; white-space: pre-wrap; }
.status { font-size: 0.88rem; }
.s-current { color: var(--ok); }
.s-legacy_unknown, .s-observed, .s-retry { color: var(--warn); }
.s-error, .s-partial, .s-deleted { color: var(--bad); }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.85rem; }
.pager { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin: 16px 0; color: var(--muted); }
.source, .related { color: var(--muted); font-size: 0.92rem; overflow-wrap: anywhere; }
.related a { margin-right: 12px; }
.empty { text-align: center; padding: 64px 0; }
.doc { overflow-wrap: anywhere; }
.doc table { margin: 12px 0; display: block; overflow-x: auto; }
.doc th, .doc td { border: 1px solid var(--line); }
.doc img, .svg img { max-width: 100%; height: auto; }
.doc-text { white-space: pre-wrap; overflow-wrap: anywhere; background: var(--soft); border-radius: 10px; padding: 14px 16px; font-size: 0.9rem; }
.doc-snippet { margin: 4px 0 0; font-size: 0.92rem; }
.img-alt { color: var(--muted); }
footer { border-top: 1px solid var(--line); color: var(--muted); font-size: 0.85rem; padding: 20px 16px; text-align: center; }
@media (max-width: 640px) {
  h1 { font-size: 1.4rem; }
  .hero h1 { font-size: 1.6rem; }
  .snippet { grid-template-columns: 1fr; }
  .snippet dt { margin-top: 4px; }
  .top nav { margin-left: 0; }
}
