.main-content:has(#tab-historiograph.active),
.content-area:has(>#tab-historiograph.active) { min-width: 0; }
.hg-root { min-width: 0; max-width: 100%; }
.hg-root h2 { margin: 0 0 .35rem; font-size: 1.45rem; }
.hg-intro,.hg-caption,.hg-state { color: var(--text-secondary); font-size: .8rem; line-height: 1.55; }
.hg-intro { margin: 0 0 1rem; }
.hg-controls { display: flex; flex-wrap: wrap; align-items: end; gap: .8rem; padding: 1rem !important; }
.hg-control { display: grid; gap: .3rem; font-size: .75rem; color: var(--text-secondary); }
.hg-control input { width: 100px; }
.hg-root input,.hg-root select { font: inherit; color: var(--text); background: var(--bg); border: 1px solid var(--border); border-radius: 6px; padding: .45rem .6rem; }
.hg-options { min-width: 170px; font-size: .8rem; }
.hg-options summary { cursor: pointer; padding: .55rem 0; }
.hg-check { display: flex; align-items: center; gap: .45rem; margin: .45rem 0; }
.hg-state:empty { display: none; }
.hg-summary { display: flex; flex-wrap: wrap; gap: 1rem 2.5rem; margin: 1rem 0; padding: 0 .25rem; }
.hg-summary div { display: grid; gap: .2rem; }
.hg-summary span { font-size: .75rem; color: var(--text-secondary); }
.hg-summary strong { font-size: 1.3rem; color: var(--text); }
.hg-selection-note { margin: -.35rem .25rem .85rem; }
.hg-graph { padding: 1rem !important; }
.hg-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: .45rem; }
.hg-toolbar h3 { margin: 0 auto 0 0; font-size: 1rem; }
.hg-toolbar select { font-size: .75rem; max-width: 160px; }
.hg-caption { margin: .65rem 0; }
.hg-viewport { overflow: auto; max-height: 560px; border: 1px solid var(--border); border-radius: 8px; background: var(--bg); }
.hg-map { display: block; touch-action: none; }
.hg-grid { stroke: var(--border); stroke-width: .6; }
.hg-axis { fill: var(--text-secondary); font: 11px sans-serif; }
.hg-edge { stroke: #94a3b8; stroke-width: 1; opacity: .45; cursor: pointer; pointer-events: stroke; }
.hg-edge.context { stroke: #d97706; stroke-dasharray: 5 4; }
.hg-edge:hover,.hg-edge:focus,.hg-edge.is-active { opacity: 1; stroke-width: 2; }
.hg-edge.is-muted { opacity: .09; }
.hg-node { fill: #6366f1; stroke: var(--card-bg,white); stroke-width: 1; cursor: pointer; }
.hg-node:hover,.hg-node:focus,.hg-node.is-selected { fill: #4338ca; stroke: #a5b4fc; stroke-width: 2.5; }
.hg-label { font: 600 11px sans-serif; fill: var(--text); paint-order: stroke; stroke: var(--bg); stroke-width: 3; pointer-events: none; }
.hg-tooltip { position: fixed; z-index: 10000; pointer-events: none; width: 360px; max-width: calc(100vw - 16px); max-height: calc(100vh - 16px); overflow: hidden; padding: .8rem; border: 1px solid var(--border); border-radius: 8px; background: var(--card-bg,white); color: var(--text); box-shadow: 0 6px 24px #0002; font-size: .78rem; line-height: 1.5; white-space: pre-line; overflow-wrap: anywhere; }
.hg-methods { padding: .8rem 1rem !important; margin-top: .75rem; }
.hg-methods>summary { cursor: pointer; font-size: .85rem; font-weight: 600; }
.hg-methods ul { padding-left: 1.2rem; font-size: .8rem; line-height: 1.65; max-width: 900px; }
.hg-methods li { margin: .45rem 0; }
.hg-methods details { margin-top: .8rem; font-size: .75rem; }
.hg-source-links { display: flex; flex-wrap: wrap; gap: .75rem; font-size: .8rem; }
.hg-source-links a { color: var(--accent); }
.hg-evidence { margin-top: .75rem; padding: 1rem !important; }
.hg-evidence[hidden] { display: none; }
.hg-evidence p { font-size: .85rem; line-height: 1.55; overflow-wrap: anywhere; }
.hg-evidence-text { white-space: pre-line; overflow-wrap: anywhere; font-size: .78rem; color: var(--text-secondary); }
.hg-evidence-title { font-weight: 600; }
.hg-evidence-list { display: grid; gap: .3rem; max-height: 300px; overflow: auto; }
.hg-evidence-link { text-align: left; border: 0; background: transparent; color: var(--accent); cursor: pointer; font: inherit; line-height: 1.5; padding: .25rem 0; overflow-wrap: anywhere; }
.hg-evidence-link:hover { text-decoration: underline; }
.hg-reference { border-top: 1px solid var(--border); padding-top: .65rem; margin-top: .65rem; }
.hg-table-scroll { overflow: auto; max-height: 420px; margin-top: .8rem; }
.hg-table-scroll table { width: 100%; table-layout: fixed; }
.hg-table-scroll th:first-child { width: 50%; }
.hg-table-scroll th,.hg-table-scroll td { overflow-wrap: anywhere; font-size: .78rem; padding: .6rem; }
.hg-empty { padding: 2rem; color: var(--text-secondary); }
@media(max-width:600px) { .hg-summary { gap: .75rem 1.5rem; } .hg-summary div { flex: 1 1 40%; } .hg-toolbar h3 { width: 100%; } .hg-options { width: 100%; } }
