/* ============================================================================
   ocellio — entity views: detail page (Puls v3 §5.5: crumbs, article card,
   filtered connections, history, sticky side column), markdown bodies (entity
   detail + shared view), the peek partial's connection groups, provenance
   trail, as-of, preview cards and the peek slide-over. Loads after graph.css.
   Colours only via tokens (tokens.css) and the k-<kind>/pjb-N step classes —
   never inline (CSP); the white/black in color-mix are the contrast darkening
   the cross badge in puls.css uses too.
   Lesbarkeit (Abnahme a44, ADR 06ac77fd): Inhalt ≥ 14 px, Sekundärtext ≥ 13 px,
   Badges und Tabellenkopf ≥ 12 px, Kontrast ≥ 4,5:1 in beiden Themes —
   geprüft von tests/e2e/test_entity_readability.py.
   ============================================================================ */

/* ---- Entitätsseite: Brotkrumen, Stand-Banner, Zweispalter --------------- */
.ed-crumbs { margin: 0 0 18px; font-size: 13px; color: var(--muted); }
.ed-crumbs .ph-crumb { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 10px;
  overflow: visible; white-space: normal; }
.crumb-back { font-weight: 600; color: var(--muted); }
.crumb-link { color: var(--muted); overflow-wrap: anywhere; }
.crumb-back:hover, .crumb-link:hover { color: var(--link); }
/* Trenner als Grafik ≥ 3:1: --faint2 erreichte hell nur 2,1:1 (wie der Feed-
   Chevron in a43, gefunden vom gemeinsamen Lesbarkeits-Scan). */
.crumb-sep { color: var(--faint); }
.crumb-cur { max-width: 40ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.asof-banner { margin: 0 0 18px; padding: 0.5rem 0.8rem; border-radius: 8px;
  font-size: 0.85rem; background: rgba(155, 122, 74, 0.12);
  border: 1px solid rgba(155, 122, 74, 0.4); }
.ed-cols { display: grid; grid-template-columns: minmax(0, 1fr); gap: 24px; align-items: start; }
@media (min-width: 768px) {
  .ed-cols { grid-template-columns: minmax(0, 1fr) minmax(260px, 340px); }
  /* Sticky, aber nie höher als der Viewport: eine lange Provenienz scrollt
     in der Spalte statt unter dem unteren Rand zu verschwinden. */
  .ed-side { position: sticky; top: 76px; max-height: calc(100dvh - 92px);
    overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; }
}

/* ---- Artikel-Karte ------------------------------------------------------- */
.ed-article { min-width: 0; padding: 28px 32px 24px; background: var(--panel);
  border: 1px solid var(--line); border-radius: 14px; }
.doc-badges { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
/* Kind-Pill: Farbregeln k-<kind> aus app.css (Text + 16 %-Fläche), Rahmen in
   Kind-Farbe; der Name ist für 4,5:1 abgedunkelt (hell) bzw. aufgehellt
   (dunkel). Der Initialkreis ist der runde Kind-Badge .kb (explorer.css) —
   eine Quelle für alle Seiten (Abnahme a44). */
.kbadge.kind-pill { width: auto; height: auto; gap: 6px; padding: 2px 11px 2px 3px;
  border: 1px solid currentColor; border-radius: 999px; font-family: var(--font-sans);
  font-weight: 600; font-size: 13px; line-height: 1.45; }
.kind-pill-t { -webkit-text-fill-color: color-mix(in oklab, currentColor 75%, #000); }
:root[data-theme="dark"] .kind-pill-t {
  -webkit-text-fill-color: color-mix(in oklab, currentColor 55%, #fff); }
.ctx-badge { font-size: 13px; font-weight: 600; line-height: 1.45; padding: 3px 10px;
  border-radius: var(--r-sm); background: var(--line2); color: var(--muted); }
.status-badge { font-size: 13px; font-weight: 600; line-height: 1.45; padding: 3px 10px;
  border-radius: var(--r-sm); background: var(--raised); color: var(--muted); }
.pj-tag { position: relative; display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 10px; border: 1px solid var(--line); border-radius: var(--r-sm);
  background: var(--panel); color: var(--muted); font-size: 13px; font-weight: 600;
  line-height: 1.45; }
.pj-tag:hover { color: var(--fg); border-color: var(--pj-cur, var(--faint2)); }
/* „NEU seit dir" (Spec §4.3): ruhig, ohne den Puls der Kachel-Badges. */
.new-tag { padding: 3px 9px; border-radius: 999px; background: var(--accent);
  color: var(--on-accent); font-family: var(--font-display); font-weight: 700;
  font-size: 12px; line-height: 1.3; }
/* --danger erreicht als 13-px-Text auf Weiß nur 4,35:1; hell dunkler (5,4:1),
   dunkel bleibt --danger (5,4:1 auf --panel). */
.ed-page .secret-flag { font-size: 13px; line-height: 1.45; color: #c0392b;
  border-color: #c0392b; }
:root[data-theme="dark"] .ed-page .secret-flag { color: var(--danger);
  border-color: var(--danger); }
.doc-title { font-family: var(--font-display); font-weight: 700;
  font-size: clamp(1.6rem, 1.2rem + 1.4vw, 2rem); line-height: 1.15;
  letter-spacing: -0.02em; margin: 0 0 10px; color: var(--fg); overflow-wrap: anywhere; }
/* Meta-Zeile: drei ruhige Blöcke (wer/wann · Version · Verbindungen), Werte in
   --fg; --muted statt --faint, das auf Weiß nur knapp 4,5:1 erreichte. */
.doc-meta { display: flex; flex-wrap: wrap; gap: 6px 22px; font-size: 14px; line-height: 1.5;
  color: var(--muted); padding-bottom: 18px; border-bottom: 1px solid var(--line);
  margin-bottom: 22px; }
.doc-meta strong { color: var(--fg); font-weight: 600; white-space: nowrap; }
.doc-v { position: relative; }
.nw { white-space: nowrap; }
.origin-row { display: flex; flex-wrap: wrap; gap: 4px 18px; margin: -8px 0 18px;
  font-size: 14px; line-height: 1.5; color: var(--muted); }
.origin-row a { color: var(--link); text-decoration: underline; text-underline-offset: 2px; }
.doc-body { font-size: 15.5px; line-height: 1.7; color: var(--fg); margin: 0 0 8px; }
/* Sektionen: Haarlinie und Luft statt kleiner Versalien-Labels. */
.doc-section { margin-top: 32px; padding-top: 24px; border-top: 1px solid var(--line); }
.doc-h { font-family: var(--font-display); font-size: 17px; font-weight: 700;
  letter-spacing: -0.01em; line-height: 1.3; color: var(--fg);
  margin: 0 0 14px; display: flex; align-items: center; gap: 10px; }
.doc-h-n { padding: 1px 9px; border-radius: 999px; background: var(--raised);
  font-family: var(--font-sans); font-size: 13px; font-weight: 600; line-height: 1.5;
  color: var(--muted); }
.ed-article .attr-list { padding: 14px 16px; border-radius: 10px; background: var(--raised);
  gap: 8px 18px; }
.ed-article .attr-key { font-size: 13px; line-height: 1.5; }
.ed-article .attr-val { font-size: 14.5px; line-height: 1.5; }

/* ---- Verbindungen: Segment-Pills, Gruppen, Zeilen ------------------------ */
.ed-h-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px;
  margin: 0 0 12px; }
.ed-h-row .doc-h { margin: 0; }
.seg { display: flex; flex-wrap: wrap; gap: 6px; margin-left: auto; }
.seg-pill { display: inline-flex; align-items: center; padding: 4px 12px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--panel); color: var(--muted);
  font-size: 13px; font-weight: 600; white-space: nowrap; transition: border-color .15s; }
.seg-pill:hover { color: var(--fg); border-color: var(--faint2); }
.seg-pill.is-on { background: var(--fg); border-color: var(--fg); color: var(--panel); }
.conn-group + .conn-group { margin-top: 20px; }
/* Gruppenkopf: Rohlabel der Relation (Spec §4.3) als ruhige Pill in der Farbe
   ihrer Familie (connections.rel_family) statt grauer Mono-Versalien. */
.conn-group { --rc: var(--muted); }
.rf-struct { --rc: var(--ev-created); } .rf-prov { --rc: var(--ev-other); }
.rf-dep { --rc: var(--ev-updated); } .rf-work { --rc: var(--ev-linked); }
.conn-group-h { display: flex; align-items: center; gap: 8px; margin: 0 0 6px;
  font-family: var(--font-sans); font-size: 13px; font-weight: 600; line-height: 1.5;
  color: var(--muted); }
summary.conn-group-h { cursor: pointer; min-height: 32px; }
.rel-raw { display: inline-flex; align-items: center; padding: 1px 10px; border-radius: 999px;
  color: color-mix(in oklab, var(--rc) 50%, var(--fg));
  background: color-mix(in oklab, var(--rc) 11%, var(--panel));
  border: 1px solid color-mix(in oklab, var(--rc) 32%, var(--panel)); }
.conn-row { display: flex; align-items: center; gap: 4px; padding: 0;
  border-bottom: 1px solid var(--line2); font-size: inherit; }
.conn-row:last-child { border-bottom: 0; }
/* Erste Spalte „auto": sie folgt der Größe von .kb (explorer.css, eine Quelle). */
.conn-link { flex: 1; display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 12px;
  align-items: center; min-height: 48px; padding: 9px 8px; border-radius: 8px; color: var(--fg); }
.conn-link:hover { background: var(--raised); color: var(--fg); }
.conn-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.conn-title { font-size: 15px; font-weight: 600; line-height: 1.4; overflow-wrap: anywhere; }
.conn-dir { color: var(--muted); font-weight: 400; }
.conn-title .xbadge { margin-left: 6px; vertical-align: 1px; }
.conn-meta { font-size: 13px; line-height: 1.45; color: var(--muted); }
.conn-chev { display: none; font-size: 18px; line-height: 1; color: var(--muted); }
.conn-row .sheet-trigger { margin-left: 0; }
.conn-empty { margin: 4px 0; font-size: 14px; color: var(--muted); }
/* Cross-Badge (puls.css, 10 px) auf der Entitätsseite in lesbarer Größe. */
.ed-page .xbadge { font-size: 12px; line-height: 1.5; padding: 0 7px; border-radius: 4px; }
.conn-reset { font-weight: 600; }
/* „Erwähnt in" und (Abnahme a44, q3) die gezählte Provenienz klappen gleich. */
details.backlinks, details.conn-fold { margin-top: 14px; }
details.backlinks > summary, details.conn-fold > summary { min-height: 36px;
  display: list-item; padding: 6px 0; font-size: 14px; font-weight: 600; line-height: 1.5;
  color: var(--muted); cursor: pointer; }
details.backlinks > summary:hover, details.conn-fold > summary:hover { color: var(--fg); }
details.backlinks .conn-group, details.conn-fold .conn-group { margin-top: 8px; }
/* Auf Touch trägt die Zeile das ⓘ fürs Bottom-Sheet (S5-C Task 5); mit
   Hover-Vorschau und Peek (Desktop-Maus) den Chevron der Spec. */
@media (hover: hover) and (min-width: 768px) {
  .conn-link { grid-template-columns: auto minmax(0, 1fr) auto; }
  .conn-chev { display: inline; }
  .conn-row .sheet-trigger { display: none; }
  /* Maus: die 44-px-Zeilen des Ego-Moduls (Touch-Ziele) dürfen schrumpfen,
     damit die Spalte meist ohne eigenen Scroll in den Viewport passt. */
  .ed-ego .ego-info, .ed-ego .ego-more-link, .ed-ego .ego-full { min-height: 0; }
  .ed-ego .ego-info { margin-top: 0; }
  .ed-ego .ego-info:empty { display: none; }
}

/* ---- Verlauf: Link in den Graphen zu diesem Zeitpunkt ------------------- */
.doc-history { display: flex; flex-direction: column; }
/* Flex mit Umbruch statt Grid: die Meta-Spalte darf bei 390 px unter den
   Text rutschen, statt die Seite quer scrollen zu lassen (a41). */
.hist-row { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px;
  min-height: 48px; padding: 11px 8px; border-bottom: 1px solid var(--line2);
  border-radius: 8px; color: var(--fg); }
.hist-row:hover { background: var(--raised); color: var(--fg); }
.hist-row:last-child { border-bottom: 0; }
.hist-dot { flex: none; width: 10px; height: 10px; border-radius: 50%; background: var(--ev-c);
  box-shadow: 0 0 0 3px color-mix(in oklab, var(--ev-c) 20%, transparent); }
.hist-ev-created { --ev-c: var(--ev-created); }
.hist-ev-updated { --ev-c: var(--ev-updated); }
.hist-ev-other { --ev-c: var(--ev-other); }
.hist-main { flex: 1 1 9rem; display: flex; flex-direction: column; min-width: 0; }
.hist-action { font-size: 14.5px; font-weight: 600; line-height: 1.45; }
.hist-v { margin-left: 6px; padding: 0 7px; border: 1px solid var(--line); border-radius: 999px;
  font-family: var(--font-mono); font-size: 12px; line-height: 1.5; color: var(--muted); }
.hist-keys { font-family: var(--font-mono); font-size: 13px; line-height: 1.45; color: var(--muted);
  overflow-wrap: anywhere; }
/* --muted statt --faint2 (Spec): Sekundärtext braucht 4,5:1 (a41-Lehre). */
.hist-meta { margin-left: auto; font-size: 13px; line-height: 1.45; color: var(--muted);
  text-align: right; min-width: 0; overflow-wrap: anywhere; }

/* ---- Teilen-Leiste (Share-Flow unverändert, nur Optik) ------------------ */
.share-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px;
  padding: 12px 14px; border-radius: 10px; background: var(--raised); font-size: 14px; }
.share-bar-txt { margin: 0; color: var(--muted); }
.share-bar-btn { margin-left: auto; padding: 7px 14px; border-radius: var(--r-sm);
  font-size: 14px; font-weight: 600; }

/* ---- Rechte Spalte: Nachbarschaft, Provenienz, Stand-Hinweis ------------ */
.ed-side { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.ed-side-card { padding: 10px 12px; background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--r); }
/* Sektions-Labels in Hanken wie überall (Review RC), aber 14 px fett in
   Satzschreibweise statt 11-px-Versalien (.sec-label in components.css bleibt
   für die anderen Seiten); der Summary am Handy trägt dasselbe Label. */
.ed-side .sec-label, .ed-ego .ego > summary { font-family: var(--font-sans); font-size: 14px;
  font-weight: 700; line-height: 1.4; letter-spacing: 0; text-transform: none; color: var(--fg); }
.ed-side .sec-label { margin: 0 0 8px; }
.ed-ego { padding: 4px 12px 8px; }
.ed-ego .ego { margin: 0; }
.ed-ego .ego-info { font-size: 14px; }
.ed-ego .ego-info-kind { font-size: 13px; color: var(--muted); }
.ed-ego .ego-more, .ed-ego .ego-more-link { font-size: 13.5px; }
/* Unter 768 px ist der Summary ein Toggle mit 44 px (Spec §4.2) und trägt das
   Label; ab 768 px ist er inaktiv (ego-pin, components.css), das Label steht
   wie bei der Provenienz über der Karte und der Summary nur für Screenreader. */
.ed-ego-label { display: none; }
@media (min-width: 768px) {
  .ed-ego-label { display: block; }
  .ed-ego { position: relative; padding-top: 10px; }
  .ed-ego .ego > summary { position: absolute; width: 1px; height: 1px; min-height: 0;
    overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
}
.ego-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 0 6px; margin: 4px 0 0;
  font-size: 13px; color: var(--muted); }
.ego-foot .ego-full { margin: 0; font-size: 13px; }
.ed-hint { font-size: 13.5px; line-height: 1.55; color: var(--muted); }
.ed-hint p { margin: 0 0 10px; }
.ed-hint code { font-size: 13px; }
.ed-hint .asof-form { flex-wrap: wrap; }
.ed-hint .asof-form input[type="date"] { min-height: 34px; font-size: 14px; }
.ed-hint .asof-form button { min-height: 34px; padding: 0 12px; font-size: 13.5px; }

/* Provenienz (UX wave B): Zeilen „Punkt · Verb + Titel"; diese Entität trägt
   den Akzent-Punkt, die übrigen einen ruhigen. Der Punkt hängt am Verb (dem
   ersten Glied jeder Zeile), nicht an der Zeilenoberkante: bricht der Titel
   um oder ist die Zeile mobil 44 px hoch, bleibt er auf der Verb-Zeile. */
/* Fließtext statt Flex-Zeile: ein langer Titel bricht neben seinem Verb um,
   statt als Block in die nächste Zeile zu rutschen (390 px, Abnahme a44). */
.trail { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.trail-row { padding-left: 20px; font-size: 14px; line-height: 1.45; }
.trail-verb { position: relative; margin-right: 6px; }
.trail-verb::before { content: ""; position: absolute; left: -18px; top: calc(50% - 5px);
  width: 10px; height: 10px; border-radius: 50%; background: var(--faint2); }
.trail-current .trail-verb::before { background: var(--accent); }
.trail-row > a { font-weight: 600; overflow-wrap: anywhere; }
.trail-this { font-weight: 700; overflow-wrap: anywhere; }
/* Verb in Sans 13 px (vorher 10-px-Mono-Versalien); ein Zweig ist am
   „(Zweig)" erkennbar, nicht an gedämpfter Deckkraft (Kontrast). */
.trail-verb { font-size: 13px; color: var(--muted); }
.trail-row > .xbadge { margin-left: 6px; vertical-align: 1px; }
.trail-status { margin-left: 6px; font-size: 13px; color: var(--muted); }
.trail-branch .trail-verb::after { content: " (Zweig)"; }

/* ---- Fokus (Tastatur) ---------------------------------------------------- */
.ed-page a:focus-visible, .ed-page button:focus-visible, .ed-page summary:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 2px; }
.conn-link:focus-visible, .hist-row:focus-visible { outline-offset: -2px; }
.kbd-focus { outline: 2px solid var(--purple, #a05cff); outline-offset: 2px;
  border-radius: 4px; }

/* ---- Touch (< 768 px oder grober Zeiger, z. B. Tablet): Ziele ≥ 44 px ---- */
@media (max-width: 767px), (pointer: coarse) {
  .ed-crumbs a { display: inline-flex; align-items: center; min-height: 44px; }
  .asof-banner a, .conn-reset, .ego-foot .ego-full {
    display: inline-flex; align-items: center; min-height: 44px; }
  /* Herkunfts-Links bleiben inline, damit ein langer Titel umbricht statt
     als Block unter sein Verb zu rutschen; das Padding trägt die 44 px. Es
     ragt 11,5 px in die Nachbarzeilen — 24 px Zeilenabstand halten die
     Trefferflächen zweier Links auseinander (Review a44: ohne Abstand
     öffnete ein Tap auf die letzte Zeile eines Links den nächsten). */
  .origin-row { row-gap: 24px; }
  .origin-row a { padding: 13px 0; }
  /* Tag-Links bleiben optisch klein; die Trefferfläche wächst unsichtbar
     auf 44 px (wie die Nachbar-Chips im Puls). */
  .pj-tag::after { content: ""; position: absolute; inset: -9px 0; }
  .doc-v::after { content: ""; position: absolute; inset: -15px -14px; }
  .seg-pill { min-height: 44px; padding: 0 14px; font-size: 13px; }
  summary.conn-group-h, details.backlinks > summary,
  details.conn-fold > summary { min-height: 44px; }
  .share-bar-btn { min-height: 44px; }
  .ed-hint .asof-form input[type="date"] { min-height: 44px; font-size: 16px; }
  .ed-hint .asof-form button { min-height: 44px; }
  /* Provenienz-Links inline mit Padding für 44 px; der Zeilenabstand hält
     die Trefferflächen auseinander. */
  .trail { gap: 24px; }
  .trail-row > a { padding: 13px 0; }
}

/* ---- Mobil (< 768 px): einspaltig ---------------------------------------- */
@media (max-width: 767px) {
  .ed-crumbs { margin: -16px 0 6px; }
  .crumb-tail { display: none; }            /* der Titel steht direkt darunter */
  .ed-article { padding: 20px 16px 16px; }
  .origin-row { margin-top: -12px; }
  .seg { margin-left: 0; width: 100%; }
  .conn-link { padding: 8px 4px; }
  .share-bar-btn { margin-left: 0; }
  /* Tabellen im Body scrollen in sich; Zellen brechen nicht Wort für Wort
     („7 / Tage"), die letzte Spalte trägt meist den längsten Text. */
  .markdown-body th, .markdown-body td { min-width: 6.5em; }
  .markdown-body td:last-child { min-width: 10em; }
}

/* ---- Reduzierte Bewegung ------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  .seg-pill { transition: none; }
}

/* --- markdown-rendered bodies (S4 entity_detail + shared_entity) ---------
   Typografie nach der Abnahme a44 („ordentlich und lesbar"): Überschriften in
   Sora mit Luft darüber, Absätze und Listen mit klarem Abstand, Marker in
   --muted, Links in --link (4,5:1 in beiden Themes), Inline-Code auf --raised,
   Tabellen mit lesbarem Kopf (13 px statt 11-px-Versalien aus app.css), am
   Handy in sich scrollend (display: block + max-content wie GitHub). */
.markdown-body { line-height: 1.7; overflow-wrap: break-word; }
.markdown-body > :first-child { margin-top: 0; }
.markdown-body > :last-child { margin-bottom: 0; }
.markdown-body h1, .markdown-body h2, .markdown-body h3, .markdown-body h4 {
  font-family: var(--font-display); font-weight: 700; line-height: 1.3;
  letter-spacing: -0.01em; color: var(--fg); }
.markdown-body h1 { font-size: 1.45em; margin: 1.6em 0 .55em; }
.markdown-body h2 { font-size: 1.25em; margin: 1.7em 0 .55em; padding-bottom: .3em;
  border-bottom: 1px solid var(--line2); }
.markdown-body h3 { font-size: 1.08em; margin: 1.5em 0 .45em; }
.markdown-body h4 { font-size: 1em; margin: 1.3em 0 .4em; }
.markdown-body p { margin: 0 0 .9em; }
.markdown-body ul, .markdown-body ol { margin: 0 0 .9em; padding-left: 1.5em; }
.markdown-body li { margin: .3em 0; padding-left: .2em; }
.markdown-body li > ul, .markdown-body li > ol { margin: .3em 0 0; }
.markdown-body li::marker { color: var(--muted); }
.markdown-body ol > li::marker { font-weight: 600; }
.markdown-body strong { font-weight: 700; color: var(--fg); }
.markdown-body a { color: var(--link); text-decoration: underline;
  text-decoration-thickness: 1px; text-underline-offset: 2px; }
.markdown-body a:hover { color: var(--link-hover); }
.markdown-body code { font-family: var(--font-mono); font-size: .92em; }
/* In Tabellen ist die Schrift schon kleiner (14,5 / Kopf 13 px): .92em davon
   fiel unter 14 bzw. 12 px (Review a44). */
.markdown-body :is(td, th) code { font-size: 1em; }
.markdown-body :not(pre) > code { padding: .1em .4em; border-radius: 5px; color: var(--fg);
  background: var(--raised); border: 1px solid var(--line2); overflow-wrap: anywhere; }
.markdown-body pre { margin: 0 0 1em; background: var(--raised); border-radius: 10px; }
.markdown-body pre code { font-size: inherit; }
.markdown-body blockquote { margin: 0 0 1em; padding: .6em 1em; border-left: 3px solid var(--accent-border);
  border-radius: 0 8px 8px 0; background: var(--raised); color: var(--muted); }
.markdown-body blockquote > :last-child { margin-bottom: 0; }
.markdown-body table { display: block; width: max-content; max-width: 100%; overflow-x: auto;
  border-collapse: collapse; margin: 0 0 1em; font-size: 14.5px; line-height: 1.5; }
.markdown-body th, .markdown-body td { border: 1px solid var(--line); padding: .5em .85em;
  text-align: left; vertical-align: top; }
.markdown-body th { background: var(--raised); color: var(--fg); font-size: 13px; font-weight: 700;
  letter-spacing: 0; text-transform: none; white-space: nowrap; }
.markdown-body tbody tr:hover { background: none; }
.markdown-body hr { border: none; border-top: 1px solid var(--line); margin: 1.6em 0; }

/* --- peek partial: grouped connections (raw relation labels) ------------ */
.connection-group-title { font-size: 0.72rem; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.06em; color: var(--faint); margin: 0.9rem 0 0.3rem; }
.connection-group:first-child > .connection-group-title { margin-top: 0; }
.connection-group summary.connection-group-title { cursor: pointer; }

/* --- UX waves C+D: time travel form (also /graph), preview cards, peek --- */
.asof-form { display: flex; gap: 0.4rem; align-items: center; }
.asof-form input[type="date"] { font-size: 0.8rem; padding: 0.15rem 0.35rem; }
.asof-form button { font-size: 0.72rem; }
.preview-pop { position: fixed; z-index: 60; width: 320px; max-width: 90vw;
  background: var(--panel, #fff); border: 1px solid rgba(127,127,127,.3);
  border-radius: 10px; padding: 0.7rem 0.85rem;
  box-shadow: 0 10px 30px rgba(0,0,0,.18); pointer-events: none; }
.preview-title { font-weight: 600; font-size: 0.92rem; margin-bottom: 0.15rem; }
.preview-meta { font-size: 0.74rem; color: var(--faint); margin-bottom: 0.4rem; }
.preview-excerpt { font-size: 0.82rem; color: var(--muted); line-height: 1.45;
  display: -webkit-box; -webkit-line-clamp: 5; -webkit-box-orient: vertical;
  overflow: hidden; }
.peek { position: fixed; top: 0; right: 0; bottom: 0; width: 440px;
  max-width: 92vw; z-index: 50; overflow-y: auto;
  background: var(--panel, #fff); border-left: 1px solid rgba(127,127,127,.3);
  box-shadow: -12px 0 36px rgba(0,0,0,.16); padding: 0.9rem 1.1rem; }
.peek-head { display: flex; align-items: center; gap: 0.6rem;
  margin-bottom: 0.6rem; }
.peek-head a { font-size: 0.82rem; margin-right: auto; }
.peek-article .entity-title { font-size: 1.25rem; }
.peek-article h2 { font-size: 0.95rem; margin: 1rem 0 0.4rem; }
