/* rdf2docs — the style every page shares. */
:root {
  --bg: #ffffff; --bg-soft: #f6f7f9; --bg-hover: #eef3fb; --line: #e3e6ea; --line-strong: #cfd4da;
  --text: #1f2328; --text-soft: #57606a; --text-faint: #8b949e;
  --accent: #0b63ce; --accent-soft: #e6f0fc; --mark: #fff3c4; --target: #d33;
  --radius: 6px; --font: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
* { box-sizing: border-box; }
html { scroll-padding-top: 64px; }
body { font-family: var(--font); color: var(--text); background: var(--bg); margin: 0; line-height: 1.45; font-size: 15px; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
small, .faint { color: var(--text-faint); font-size: .82em; }
code, .mono { font-family: var(--mono); font-size: .88em; }
h1 { font-size: 1.6em; margin: .2em 0 .1em; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
h2 { font-size: 1.15em; margin: 1.4em 0 .5em; }

/* ── Header and navigation ─────────────────────────────────────────────── */
.site-header { position: sticky; top: 0; z-index: 50; background: rgba(255,255,255,.96); backdrop-filter: blur(4px);
  border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 18px; padding: 8px 20px; }
.site-header .brand { font-weight: 700; color: var(--text); white-space: nowrap; }
.site-header nav { display: flex; gap: 4px; flex-wrap: wrap; }
.site-header nav a { padding: 5px 10px; border-radius: var(--radius); color: var(--text-soft); font-size: .92em; }
.site-header nav a:hover { background: var(--bg-hover); text-decoration: none; color: var(--accent); }
.site-header nav a.current { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.site-header .spacer { flex: 1; }
.page { max-width: 1240px; margin: 0 auto; padding: 18px 24px 60px; }
.breadcrumb { font-size: .85em; color: var(--text-faint); margin-bottom: 4px; }
.breadcrumb a { color: var(--text-soft); }
.iri { color: var(--text-soft); font-size: .82em; word-break: break-all; font-family: var(--mono); display: flex; gap: 8px; align-items: center; }
.copy { border: 1px solid var(--line); background: var(--bg); border-radius: 4px; cursor: pointer; font-size: .9em; padding: 1px 6px; color: var(--text-soft); }
.copy:hover { background: var(--bg-hover); }
.meta-links { font-size: .85em; margin: 6px 0 0; display: flex; gap: 14px; flex-wrap: wrap; }
.notice { background: #fff8e1; border: 1px solid #f0d080; padding: 10px 14px; border-radius: var(--radius); }

/* ── Types: their icons as meta.linked.archi publishes them ─────────────────
 * The type's picture (its whole figure, 130 × 60), else its glyph alone, else nothing — each in the same box, so
 * that the names beside them line up. */
.ti { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 16px; flex-shrink: 0;
  margin-right: 6px; vertical-align: -3px; line-height: 1; }
.ti img { display: block; object-fit: contain; }
.ti.pic img { width: 32px; height: 16px; }
.ti.bare img { width: 16px; height: 16px; }
.ti.mark { color: #5f6368; font-size: 13px; }
.h1-icon .ti { width: 68px; height: 32px; margin: 0; }
.h1-icon .ti.pic img { width: 68px; height: 32px; }
.h1-icon .ti.bare img { width: 30px; height: 30px; }
.h1-icon .ti.mark { font-size: 26px; }
.h1-icon .ti.none { display: none; }
.big-icon .ti { width: 40px; height: 20px; vertical-align: middle; }
.big-icon .ti.bare img { width: 18px; height: 18px; }
.type-badge { display: inline-flex; align-items: center; gap: 4px; font-size: .78em; font-weight: 500; color: var(--text-soft);
  background: var(--bg-soft); border: 1px solid var(--line); border-radius: 999px; padding: 1px 9px 1px 6px; white-space: nowrap; text-decoration: none; }
.type-badge .ti { width: 26px; height: 13px; margin: 0; }
.type-badge .ti.pic img { width: 26px; height: 13px; }
.type-badge .ti.bare img { width: 13px; height: 13px; }
.type-badge .ti.none { display: none; }
a.type-badge:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; }
.group-badge { font-size: .72em; color: var(--text-faint); border: 1px dashed var(--line-strong); border-radius: 999px; padding: 0 7px; white-space: nowrap; }
.name-cell { display: flex; align-items: center; gap: 2px; min-width: 0; }
.name-cell a { overflow-wrap: anywhere; }

/* ── Tables ────────────────────────────────────────────────────────────── */
table { width: 100%; border-collapse: collapse; margin: 8px 0 4px; font-size: .93em; }
th, td { border-bottom: 1px solid var(--line); padding: 7px 10px; text-align: left; vertical-align: top; }
th { background: var(--bg-soft); font-weight: 600; color: var(--text-soft); font-size: .88em; position: relative; }
tbody tr:hover { background: #fafbfc; }
tr:target, tr.hit { background: var(--mark); }
table.sortable th { cursor: pointer; user-select: none; padding-right: 20px; }
table.sortable th::after { content: "↕"; position: absolute; right: 6px; color: var(--line-strong); font-size: .85em; }
table.sortable th.asc::after { content: "↑"; color: var(--accent); }
table.sortable th.desc::after { content: "↓"; color: var(--accent); }
table.part { width: auto; margin: 0; font-size: .92em; }
table.part td { padding: 3px 8px; border-color: var(--line); }
td.iri-cell { font-family: var(--mono); font-size: .78em; color: var(--text-soft); word-break: break-all; }
.details-table td:first-child { width: 28%; color: var(--text-soft); }
.details-table .pred { display: block; font-size: .78em; color: var(--text-faint); font-family: var(--mono); }
.text { white-space: pre-wrap; }
.count { display: inline-block; min-width: 20px; text-align: center; font-size: .75em; font-weight: 600; color: var(--text-soft);
  background: var(--bg-soft); border: 1px solid var(--line); border-radius: 999px; padding: 0 6px; margin-left: 6px; }
.dir { font-size: .8em; color: var(--text-soft); white-space: nowrap; }
.empty { color: var(--text-faint); font-style: italic; }

/* ── Filters, groups ───────────────────────────────────────────────────── */
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin: 10px 0; }
.toolbar input[type=search], .toolbar select { padding: 6px 10px; border: 1px solid var(--line-strong); border-radius: var(--radius); font-size: .92em; background: var(--bg); }
.toolbar input[type=search] { min-width: 260px; }
.toolbar label { font-size: .88em; color: var(--text-soft); display: inline-flex; gap: 5px; align-items: center; }
.btn { border: 1px solid var(--line-strong); background: var(--bg); border-radius: var(--radius); padding: 5px 11px; cursor: pointer; font-size: .88em; color: var(--text); }
.btn:hover { background: var(--bg-hover); border-color: var(--accent); }
.btn.primary { background: var(--accent); color: #fff; border-color: var(--accent); }
.btn.primary:hover { background: #0954b0; }
.seg { display: inline-flex; border: 1px solid var(--line-strong); border-radius: var(--radius); overflow: hidden; }
.seg button { border: 0; background: var(--bg); padding: 5px 12px; cursor: pointer; font-size: .88em; color: var(--text-soft); border-right: 1px solid var(--line); }
.seg button:last-child { border-right: 0; }
.seg button.on { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
details.group { border: 1px solid var(--line); border-radius: var(--radius); margin: 8px 0; background: var(--bg); }
details.group > summary { list-style: none; cursor: pointer; padding: 8px 12px; display: flex; align-items: center; gap: 8px; font-weight: 600; background: var(--bg-soft); border-radius: var(--radius); }
details.group[open] > summary { border-bottom: 1px solid var(--line); border-radius: var(--radius) var(--radius) 0 0; }
details.group > summary::-webkit-details-marker { display: none; }
details.group > summary::before { content: "▸"; color: var(--text-faint); transition: transform .15s; display: inline-block; }
details.group[open] > summary::before { transform: rotate(90deg); }
details.group > .group-body { padding: 4px 12px 10px; }
details.group details.group { margin-left: 4px; }
details.group details.group > summary { font-weight: 500; background: var(--bg); }
.group-tools { margin-left: auto; font-weight: 400; font-size: .8em; }
.hidden { display: none !important; }

/* ── Tabs ──────────────────────────────────────────────────────────────── */
.tabs { margin-top: 26px; border-bottom: 1px solid var(--line-strong); display: flex; gap: 2px; flex-wrap: wrap; }
.tab-btn { padding: 8px 14px; border: none; background: none; cursor: pointer; font-size: .93em; color: var(--text-soft); border-bottom: 2px solid transparent; margin-bottom: -1px; font-family: inherit; }
.tab-btn:hover { color: var(--accent); }
.tab-btn.active { border-bottom-color: var(--accent); color: var(--accent); font-weight: 600; }
.tab-panel { padding-top: 6px; }

/* ── Diagram: zoomed and panned in its viewport ──────────────────────────── */
.diagram-wrap { border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg); margin-top: 8px; }
.diagram-wrap:fullscreen { display: flex; flex-direction: column; border-radius: 0; }
.diagram-wrap:fullscreen .diagram { flex: 1; height: auto !important; }
.diagram-bar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; padding: 6px 10px; border-bottom: 1px solid var(--line); background: var(--bg-soft); border-radius: var(--radius) var(--radius) 0 0; font-size: .88em; }
.diagram-bar select { padding: 3px 6px; border-radius: 4px; border: 1px solid var(--line-strong); }
.diagram-bar .zoom { font-family: var(--mono); color: var(--text-soft); min-width: 46px; text-align: center; }
.diagram { position: relative; overflow: hidden; height: 60vh; cursor: grab; touch-action: none; user-select: none; background:
  radial-gradient(circle, #e6e9ed 1px, transparent 1px) 0 0 / 16px 16px; outline: none; }
.diagram:focus-visible { box-shadow: inset 0 0 0 2px var(--accent-soft); }
.diagram.dragging { cursor: grabbing; }
.diagram.dragging a { cursor: grabbing; }
.diagram svg { display: block; width: 100%; height: 100%; }
.diagram .la-connection-label { display: none; }
.diagram.names .la-connection-label, .diagram .la-connector-label { display: inline; }
.diagram a:hover .la-shape-body { filter: brightness(.96); }
.diagram a:hover .la-connection { stroke-width: 2.2; }
.diagram .node:target .la-shape-body, .diagram .node:target .la-icon-container { stroke: var(--target); stroke-width: 3; }
.diagram .node:target .la-icon-container { stroke-dasharray: 4 3; }
.diagram .link:target .la-connection { stroke: var(--target); stroke-width: 3; }
.diagram .point:target { fill: var(--target); }
.diagram .highlight .la-shape-body, .diagram .highlight .la-icon-container { stroke: var(--target); stroke-width: 3; }
.diagram .highlight .la-connection, .diagram .la-connection.highlight { stroke: var(--target); stroke-width: 3; }
.diagram-hint { position: absolute; right: 8px; bottom: 6px; font-size: .75em; color: var(--text-faint); background: rgba(255,255,255,.85); padding: 1px 6px; border-radius: 4px; pointer-events: none; }
.legend { display: flex; gap: 6px 14px; flex-wrap: wrap; font-size: .82em; color: var(--text-soft); padding: 6px 10px; border-top: 1px solid var(--line); }
.legend span[data-type] { display: inline-flex; align-items: center; gap: 2px; cursor: pointer; }
.legend span[data-type]:hover, .legend span.on { color: var(--accent); }
.legend .ti { width: 28px; height: 14px; margin-right: 3px; }
.legend .ti.pic img { width: 28px; height: 14px; }
.legend .ti.bare img { width: 14px; height: 14px; }

/* ── The shell: the model tree on the left, the page beside it ─────────── */
.shell { display: flex; align-items: stretch; min-height: calc(100vh - 49px); }
.shell > .page, .shell > .main { flex: 1; min-width: 0; }
.shell > .page { margin: 0; max-width: none; padding: 18px 28px 60px; }
.tree-panel { width: 300px; flex-shrink: 0; border-right: 1px solid var(--line); background: #fff; position: sticky; top: 49px;
  height: calc(100vh - 49px); display: flex; flex-direction: column; font-size: 13px; user-select: none; }
body.tree-hidden .tree-panel { display: none; }
.tree-toggle { border: 1px solid var(--line); background: var(--bg); border-radius: 4px; cursor: pointer; font-size: 14px; padding: 2px 8px; color: var(--text-soft); }
.tree-toggle:hover { background: var(--bg-hover); }
.explorer-header { padding: 8px 12px; font-weight: 600; border-bottom: 1px solid #e0e0e0; display: flex; align-items: center; gap: 6px; }
.explorer-header .grouping { margin-left: auto; display: inline-flex; border: 1px solid #dadce0; border-radius: 4px; overflow: hidden; }
.explorer-header .grouping button { border: 0; background: #fff; color: #3c4043; font: inherit; font-size: 11px; font-weight: 400; padding: 1px 8px; cursor: pointer; }
.explorer-header .grouping button + button { border-left: 1px solid #dadce0; }
.explorer-header .grouping button:hover:not(:disabled) { background: #f1f3f4; }
.explorer-header .grouping button:disabled { color: #9aa0a6; cursor: default; }
.explorer-header .grouping button[aria-pressed="true"] { background: #e8f0fe; color: #1a73e8; }
.tree-hide { border: 0; background: none; cursor: pointer; color: #80868b; font-size: 14px; padding: 0 2px; }
.tree-panel .filter-input { display: block; margin: 6px 8px; padding: 4px 8px; border: 1px solid #ccc; border-radius: 4px; font: inherit; }
.tree-panel .filter-input:focus { outline: none; border-color: #1a73e8; box-shadow: 0 0 0 1px #1a73e8; }
.tree-scroll { overflow: auto; flex: 1 1 auto; min-height: 0; padding-bottom: 20px; }
.tree-panel ul { list-style: none; margin: 0; padding: 0; }
.tree-panel ul ul { padding-left: 14px; }
.tree-panel .row { display: flex; align-items: center; gap: 4px; padding: 2px 8px; cursor: pointer; white-space: nowrap; }
.tree-panel .row:hover { background: #eef3fd; }
.tree-panel .row.selected { background: #d2e3fc; }
.tree-panel .toggle { width: 12px; flex: none; text-align: center; font-size: 9px; color: #666; }
.tree-panel .ti { width: 30px; height: 14px; margin: 0 2px 0 0; vertical-align: middle; }
.tree-panel .ti.pic img { width: 30px; height: 14px; }
.tree-panel .ti.bare img { width: 14px; height: 14px; }
.tree-panel .label { overflow: hidden; text-overflow: ellipsis; flex: 1 1 auto; color: inherit; text-decoration: none; }
.tree-panel a.label:hover { text-decoration: underline; color: #1a73e8; }
.tree-panel .row.active .label { font-weight: 600; color: #1a73e8; }
.tree-panel .row.folder > .label { color: #3c4043; }
.tree-panel .row.model > .label { font-weight: 600; }
.tree-panel .detail { font-size: 11px; color: #80868b; flex: none; }
.tree-panel .placed { width: 6px; height: 6px; border-radius: 50%; background: #1a73e8; flex: none; }
.tree-panel .empty { padding: 12px; color: #80868b; font-style: italic; }

/* ── The header's menus ─────────────────────────────────────────────────── */
#site-menus { display: flex; gap: 4px; }
.menu-drop { position: relative; }
.menu-btn { border: 0; background: none; padding: 5px 10px; border-radius: var(--radius); color: var(--text-soft); font: inherit; font-size: .92em; cursor: pointer; }
.menu-btn:hover, .menu-drop.open .menu-btn { background: var(--bg-hover); color: var(--accent); }
.menu-panel { display: none; position: absolute; top: calc(100% + 4px); left: 0; z-index: 60; min-width: 220px; max-height: 70vh; overflow-y: auto;
  background: #fff; border: 1px solid var(--line-strong); border-radius: var(--radius); box-shadow: 0 6px 22px rgba(0,0,0,.14); padding: 6px 0; font-size: .9em; }
.menu-panel.wide { min-width: 320px; }
.menu-drop.open .menu-panel { display: block; }
.menu-panel > a { display: flex; align-items: center; padding: 5px 12px; color: var(--text); }
.menu-panel > a:hover { background: var(--bg-hover); text-decoration: none; color: var(--accent); }
.menu-filter { width: calc(100% - 20px); margin: 2px 10px 6px; padding: 5px 8px; border: 1px solid var(--line-strong); border-radius: var(--radius); font: inherit; }
.menu-tree ul { list-style: none; margin: 0; padding-left: 14px; }
.menu-tree > ul { padding-left: 4px; }
.menu-tree a { display: block; padding: 3px 8px; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.menu-tree a:hover { background: var(--bg-hover); color: var(--accent); text-decoration: none; }
.menu-head { font-size: .75em; text-transform: uppercase; letter-spacing: .05em; color: var(--text-faint); padding: 6px 12px 2px; }

/* ── Index ─────────────────────────────────────────────────────────────── */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin: 12px 0 18px; }
.card { border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px; background: var(--bg); }
.card .n { font-size: 1.5em; font-weight: 700; }
.card .l { font-size: .82em; color: var(--text-soft); }
.card a { color: inherit; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 16px; }
.chip { display: inline-flex; align-items: center; gap: 4px; font-size: .82em; border: 1px solid var(--line); border-radius: 999px; padding: 2px 10px 2px 6px; background: var(--bg); cursor: pointer; color: var(--text); }
.chip:hover { border-color: var(--accent); color: var(--accent); }
.chip.off { opacity: .45; }
.chip .ti { width: 28px; height: 14px; margin: 0; }
.chip .ti.pic img { width: 28px; height: 14px; }
.chip .ti.bare img { width: 14px; height: 14px; }
.chip .ti.none { display: none; }
.thumb { height: 30px; width: 46px; object-fit: cover; margin-right: 6px; vertical-align: middle; border: 1px solid var(--line); border-radius: 3px; }

/* ── Code (RDF, SPARQL) ────────────────────────────────────────────────── */
.code { font-family: var(--mono); font-size: 12.5px; line-height: 1.5; white-space: pre; overflow: auto; background: #fbfbfc; border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px; margin: 0; }
.tok-kw { color: #8250df; font-weight: 600; } .tok-iri { color: #0550ae; } .tok-pn { color: #116329; } .tok-lit { color: #a31515; }
.tok-lang { color: #953800; } .tok-num { color: #0b7285; } .tok-com { color: #6e7781; font-style: italic; } .tok-var { color: #953800; } .tok-punc { color: #6e7781; }
mark { background: #ffe58f; padding: 0; border-radius: 2px; }
mark.current { background: #ffb35c; }

@media (max-width: 820px) {
  .shell { flex-direction: column; }
  .tree-panel { width: 100%; position: static; height: auto; max-height: 40vh; border-right: 0; border-bottom: 1px solid var(--line); }
  .page, .shell > .page { padding: 14px 16px 40px; }
  .toolbar input[type=search] { min-width: 0; width: 100%; }
  .site-header { padding: 8px 16px; gap: 10px; }
}
