:root {
  --ink: #17201f; --muted: #56686a; --line: #dbe6e3; --bg: #f5f8f7; --panel: #fff;
  --navy: #0f6b62; --accent: #b45309; --tint: #e3f1ee; --ok: #1a7f37; --warn: #b7791f; --bad: #c62828;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}
* { box-sizing: border-box; }
body { margin: 0; font: 15px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, sans-serif; color: var(--ink); background: var(--bg); }
a { color: var(--navy); }
.layout { display: grid; grid-template-columns: 250px 1fr; min-height: 100vh; }

.sidebar { background: #0b2926; color: #cfe3de; border-top: 4px solid #d97706; padding: 18px 14px; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.brand { color: #fff; font-weight: 700; font-size: 17px; text-decoration: none; }
.brand-sub { font-size: 12px; color: #93b5ae; margin: 6px 0 14px; line-height: 1.4; }
.nav-group { text-transform: uppercase; font-size: 11px; letter-spacing: .08em; color: #f0b45b; margin: 16px 0 4px; }
.sidebar ul { list-style: none; margin: 0; padding: 0; }
.sidebar li a { display: block; padding: 5px 9px; border-radius: 6px; color: #d8ebe7; text-decoration: none; font-size: 14px; }
.sidebar li a:hover { background: #143f3a; }
.sidebar li a.active { background: #1d655c; color: #fff; box-shadow: inset 3px 0 0 #f0b45b; }
.nav-foot { font-size: 11px; color: #7fa39c; margin-top: 22px; line-height: 1.4; }
.nav-credit { font-size: 12px; color: #b7d3cd; }
.nav-credit + .nav-foot { margin-top: 10px; }
.nav-foot a { color: #f0b45b; }

.content { padding: 26px 34px 60px; max-width: 1400px; min-width: 0; }
h1 { font-size: 24px; margin: 0 0 14px; }
.prose { max-width: 860px; }
.prose h2 { font-size: 18px; margin-top: 26px; }
.prose code, .qhead code { font-family: var(--mono); font-size: 13px; background: var(--tint); padding: 1px 4px; border-radius: 4px; }
.prose em:first-child:last-child { color: var(--muted); }
.prose table { border-collapse: collapse; }
.prose td, .prose th { border: 1px solid var(--line); padding: 4px 10px; }

.params { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: end; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 10px 14px; margin-bottom: 16px; }
.params label { display: flex; flex-direction: column; font-size: 12px; color: var(--muted); gap: 3px; }
.params label.check { flex-direction: row; align-items: center; gap: 6px; font-size: 13px; color: var(--ink); }
.params input, .params select { font: inherit; padding: 4px 7px; border: 1px solid #cbd1db; border-radius: 6px; }
button { font: inherit; padding: 5px 14px; border-radius: 6px; border: 1px solid var(--navy); background: var(--navy); color: #fff; cursor: pointer; }
button.linkish { background: none; border: none; color: var(--navy); padding: 0 4px; text-decoration: underline; }

.status { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.pill { font-size: 12px; padding: 3px 10px; border-radius: 999px; border: 1px solid; }
.pill.ok { color: var(--ok); border-color: #b9dcc3; background: #eef8f1; }
.pill.warn { color: var(--warn); border-color: #ecd6a8; background: #fdf6e7; }
.pill.bad { color: var(--bad); border-color: #efc1c1; background: #fdeeee; }
.error { color: var(--bad); background: #fdeeee; border: 1px solid #efc1c1; padding: 8px 12px; border-radius: 6px; }
.note { color: var(--muted); font-size: 13px; }

.query { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 12px 16px; margin: 16px 0; }
.qhead { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.meta { color: var(--muted); font-size: 13px; margin-left: auto; }
.engine, .compare .e { font: 600 11px var(--mono); text-transform: uppercase; padding: 2px 7px; border-radius: 4px; color: #fff; background: #5b6475; }
.engine.sparql, .e.sparql { background: #0f6b62; }
.engine.sql, .e.sql { background: #8a5a00; }
.engine.update { background: #6b2d8a; }
details { margin: 8px 0; }
summary { cursor: pointer; color: var(--muted); font-size: 13px; }
.code { position: relative; }
.code pre { background: #0d2422; color: #dcefea; padding: 12px 14px; border-radius: 8px; overflow-x: auto; font: 12.5px/1.45 var(--mono); margin: 6px 0; }
.copy { position: absolute; right: 8px; top: 8px; font-size: 11px; padding: 2px 8px; background: #1f4a45; border-color: #1f4a45; }
.tablewrap { overflow-x: auto; max-height: 560px; overflow-y: auto; border: 1px solid var(--line); border-radius: 6px; margin-top: 8px; }
table { border-collapse: collapse; width: 100%; font-size: 13px; }
th { position: sticky; top: 0; background: var(--tint); text-align: left; font-weight: 600; }
th, td { padding: 5px 9px; border-bottom: 1px solid var(--line); vertical-align: top; }
tbody tr:hover { background: #f4f7fc; }

.bars { margin: 10px 0; max-width: 760px; }
.bar { display: grid; grid-template-columns: 290px 1fr 60px; gap: 10px; align-items: center; font-size: 13px; margin: 3px 0; }
.bt { background: #eef1f6; border-radius: 4px; height: 14px; }
.bt span { display: block; height: 100%; background: var(--navy); border-radius: 4px; }
.bn { text-align: right; font-variant-numeric: tabular-nums; }

.compare { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; margin: 14px 0; }
.num { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 14px; }
.num .n { font-size: 34px; font-weight: 700; color: var(--accent); }
.num .l { font-size: 13px; color: var(--ink); margin: 2px 0 8px; }

.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 12px; color: var(--muted); margin-bottom: 8px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.ln { display: inline-block; width: 22px; height: 3px; border-radius: 2px; }
.ln.full { background: #1a7f37; } .ln.partial { background: #d4a017; } .ln.self { background: #c62828; }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; }
.dot.local { background: #1f4e99; } .dot.owner { background: #6b7280; } .dot.top { background: #b3261e; }
.mapgrid { display: grid; grid-template-columns: 1fr 340px; gap: 12px; }
#map { height: 64vh; min-height: 420px; border-radius: 10px; border: 1px solid var(--line); background: #e9eef5; }
.chainlist { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 10px; display: flex; flex-direction: column; height: 64vh; min-height: 420px; }
.stats { font-size: 13px; color: var(--muted); margin-bottom: 8px; }
#filter { font: inherit; padding: 5px 8px; border: 1px solid #cbd1db; border-radius: 6px; margin-bottom: 6px; }
#chains { list-style: none; margin: 0; padding: 0; overflow-y: auto; flex: 1; }
#chains li { padding: 6px 8px; border-radius: 6px; cursor: pointer; border-bottom: 1px solid var(--line); }
#chains li:hover { background: #f4f7fc; }
#chains li.sel { background: #e6edf9; }
#chains .s { display: block; font-size: 13px; font-weight: 600; }
#chains .t { display: block; font-size: 12px; color: var(--muted); }
#chains em { font-style: normal; font-weight: 600; color: var(--accent); }
.chips { margin: 10px 0; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.chips-label { font-size: 12px; color: var(--muted); margin-right: 4px; }
.chips button { background: var(--panel); color: var(--ink); border: 1px solid var(--line); padding: 2px 9px; font-size: 12px; }
.corr { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; vertical-align: middle; }
.pager { display: flex; justify-content: space-between; margin-top: 30px; padding-top: 14px; border-top: 1px solid var(--line); }

@media (max-width: 1000px) {
  .layout { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; }
  .mapgrid { grid-template-columns: 1fr; }
}
.basemap { filter: grayscale(1) brightness(1.06) contrast(.9); }

/* The data-spine notes page (apps/demo/templates/demo/spine.html) */
.spine { --spine: #1f3a68; --fact: #8a5a00; --ctx: #6b2d8a; --ref: #9aa6bb; max-width: 1180px; font-size: 14px; }
.spine h2 { font-size: 13px; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); margin: 20px 0 8px; }
.spine .question { font-size: 15px; }
.spine .question b { color: var(--accent); }
.spine .layers { display: grid; grid-template-columns: 1.25fr 1fr .8fr; gap: 12px; }
.spine .layer { border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; background: var(--panel); }
.spine .layer h3 { margin: 0 0 6px; font-size: 14px; }
.spine .layer h3 small { font-weight: 400; color: var(--muted); font-size: 12px; margin-left: 6px; }
.spine .layer.spine { border-top: 4px solid var(--spine); }
.spine .layer.fact { border-top: 4px solid var(--fact); }
.spine .layer.ctx { border-top: 4px solid var(--ctx); }
.spine .layer ul { margin: 0; padding-left: 18px; }
.spine .layer li { margin: 3px 0; }
.spine .say { color: var(--muted); font-style: italic; }
.spine table { font-size: 13px; background: var(--panel); }
.spine th { position: static; }
.spine th.t, .spine td.t { text-align: center; width: 70px; }
.spine th.t.s { color: var(--spine); } .spine th.t.f { color: var(--fact); }
.spine td.p { font-weight: 600; white-space: nowrap; }
.spine td.p small { display: block; font-weight: 400; color: var(--muted); }
.spine .core, .spine .ref { display: inline-block; width: 11px; height: 11px; border-radius: 50%; }
.spine .core { background: var(--spine); }
.spine .ref { border: 2px solid var(--ref); }
.spine td.where em { color: var(--muted); font-style: normal; }
.spine tr.consumer td { background: #f1f3f7; }
.spine .tablewrap { max-height: none; }
.spine .key { color: var(--muted); font-size: 12px; margin-top: 6px; display: flex; gap: 16px; flex-wrap: wrap; align-items: center; }
.spine .key span { display: inline-flex; align-items: center; gap: 5px; }
.spine .bottom { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.spine .bottom li { margin: 4px 0; }
.spine footer { margin-top: 14px; color: var(--muted); font-size: 12px; border-top: 1px solid var(--line); padding-top: 6px; }
@media (max-width: 1000px) { .spine .layers, .spine .bottom { grid-template-columns: 1fr; } }

/* Preformatted blocks in the explanations (the Help page's data diagram) */
.prose pre { background: #f6f7fa; border: 1px solid #e3e6ee; padding: 12px 14px; border-radius: 8px; overflow-x: auto; font: 12px/1.4 var(--mono); }
.prose pre code { background: none; padding: 0; font: inherit; }
.prose img.diagram { width: 100%; max-width: 1080px; height: auto; border: 1px solid var(--line); border-radius: 8px; }

/* The semantics-ladder pages (apps/demo/templates/demo/ladder*.html) */
.ladder-flag { display: inline-block; margin: 0 0 14px; font-size: 12px; color: var(--warn); border: 1px solid #ecd6a8; background: #fdf6e7; border-radius: 999px; padding: 3px 10px; }
.ladder { --correct: #1a7f37; --partial: #b7791f; --wrong: #c62828; }
.ladder h2 { font-size: 18px; margin: 28px 0 8px; }
.ladder h3 { font-size: 14px; margin: 18px 0 2px; }
.ladder code { font-family: var(--mono); font-size: 12.5px; }
.ladder .num .n { color: var(--navy); }
.ladder .tablewrap.flat { max-height: none; background: var(--panel); }
.ladder th { position: static; }
.ladder th.n, .ladder td.n { text-align: center; white-space: nowrap; }
.ladder td.term { white-space: nowrap; }
.ladder table.scores td.n { font-variant-numeric: tabular-nums; }
.ladder tr.mean td { font-weight: 700; background: #f4f6fa; }
.ladder .chiplist { white-space: nowrap; }
.qchip { display: inline-block; font: 600 11px var(--mono); color: var(--navy); background: var(--tint); border-radius: 4px; padding: 1px 5px; margin-right: 3px; text-decoration: none; }
.qchip.big { font-size: 13px; padding: 2px 7px; }
.trapcard { scroll-margin-top: 12px; }
.trapcard:target { border-color: var(--navy); box-shadow: 0 0 0 2px #bfe0d9; }
.trapcard p { margin: 8px 0; }
.trapcard .trap b { color: var(--accent); }
.mark { display: inline-block; width: 20px; height: 20px; line-height: 20px; margin: 1px; text-align: center; border-radius: 4px; font-size: 12px; font-weight: 700; color: #fff; background: var(--muted); }
.mark.correct { background: var(--correct, #1a7f37); }
.mark.partial { background: var(--partial, #b7791f); }
.mark.wrong { background: var(--wrong, #c62828); }
.answers { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 10px; }
.answer { border: 1px solid var(--line); border-top: 3px solid var(--muted); border-radius: 8px; padding: 8px 12px; font-size: 13.5px; }
.answer.correct { border-top-color: var(--correct); }
.answer.partial { border-top-color: var(--partial); }
.answer.wrong { border-top-color: var(--wrong); }
.answer .ahead { display: flex; justify-content: space-between; align-items: center; }
.answer .atext p { margin: 6px 0; }
.answer .why { margin: 6px 0 0; padding-top: 6px; border-top: 1px dashed var(--line); font-size: 12.5px; color: var(--muted); }
.source { margin-top: 22px; }
.source pre { max-height: 560px; }
.ladder .range { display: block; color: var(--muted); font-size: 11px; font-weight: 400; }
.ladder details.query summary { color: var(--ink); font-size: 14px; }
.ladder .count { display: inline-block; min-width: 30px; margin: 1px; padding: 0 4px; border-radius: 4px; font-variant-numeric: tabular-nums; background: #fdeeee; color: var(--bad); }
.ladder .count.right { background: #eef8f1; color: var(--ok); font-weight: 600; }

/* --- semantics ladder ------------------------------------------------------------------- */
.dim { color: var(--muted); font-weight: 400; font-size: 12px; }
h2 { font-size: 18px; margin: 26px 0 8px; }
.tablewrap.flat { max-height: none; background: var(--panel); }
td.term { white-space: nowrap; }
th.n, td.n { text-align: center; white-space: nowrap; }
.cond { display: inline-block; margin: 1px 10px 1px 0; white-space: nowrap; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin: 0 0 16px; }
.tabs a { padding: 6px 12px; text-decoration: none; border: 1px solid transparent; border-bottom: none; border-radius: 6px 6px 0 0; color: var(--muted); }
.tabs a.on { background: var(--panel); border-color: var(--line); color: var(--ink); font-weight: 600; margin-bottom: -1px; }
table.grid td.marks { white-space: nowrap; font-size: 12px; letter-spacing: -1px; }
.card.correct { border-left: 4px solid var(--ok); }
.card.partial { border-left: 4px solid var(--warn); }
.card.wrong { border-left: 4px solid var(--bad); }
.source { margin-top: 14px; }
.source pre { max-height: 560px; white-space: pre-wrap; }
.pill a { color: inherit; text-decoration: none; }

/* Semantics ladder pages */
h1 { color: #0b2926; }
.prose h2, .content > h2 { color: #0f6b62; }
.flag { display: inline-block; margin: 0 0 14px; font-size: 12px; color: var(--accent); border: 1px solid #f3d3a6; background: #fdf4e6; border-radius: 999px; padding: 3px 10px; }
.scorerow { margin: 10px 0 18px; }
.scorehead { font-size: 14px; font-weight: 600; }
.scorerow .compare { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin: 8px 0; }
.scorerow .num { padding: 10px 12px; border-top: 3px solid var(--navy); }
.scorerow .num .n { font-size: 26px; color: var(--navy); }
.scorerow .num .l { margin: 2px 0 0; }
.num .ci { font-size: 11px; color: var(--muted); }

/* a condition's label, R4 or D2, before its name */
.lbl { display: inline-block; font: 600 11px/1.5 var(--mono); color: #fff; background: var(--navy); padding: 0 5px; border-radius: 4px; margin-right: 2px; vertical-align: 1px; }

/* the latest runs side by side, on the home page and each domain's introduction */
table.scores { width: auto; margin: 6px 0 18px; }
table.scores th, table.scores td { border-bottom: 1px solid var(--line); padding: 5px 12px; vertical-align: top; }
table.scores th { position: static; }
table.scores td.n, table.scores th.n { text-align: right; }
