/* Shared loaded-workspace layout and typography. Theme switches change paint only. */
.ui-icon { display: inline-block; width: 20px; height: 20px; flex: none; vertical-align: middle; }
.btn .ui-icon { width: 18px; height: 18px; }
.lang-flag { width: 24px; height: 18px; object-fit: contain; border-radius: 2px; background: transparent; box-shadow: 0 0 0 1px rgba(0, 0, 0, .12); }
.language-option { min-height: 38px; gap: 10px; font-size: 14px; }
[data-theme] body.has-data { --sidebar-w: 232px; }
[data-theme] .app { font-size: 16px; }
[data-theme] .sidebar { padding: 22px 0 30px; }
[data-theme] .nav-group { gap: 2px; margin-bottom: 18px; }
[data-theme] .nav-title { padding: 0 18px 9px; font-family: var(--font); font-size: 11px; font-weight: 700; letter-spacing: .09em; }
[data-theme] .nav-title::after { background: var(--nav-line); }
[data-theme] .nav-item { padding: 8px 18px 8px 15px; min-height: 38px; font-size: 14px; gap: 12px; }
[data-theme] .nav-item:hover { border-left-color: transparent; }
[data-theme] .nav-icon,
[data-theme] .nav-item.active .nav-icon { background: none; color: currentColor; width: 20px; height: 20px; }
[data-theme] .nav-item:focus-visible { outline: 2px solid var(--accent-ink); outline-offset: -3px; }
/* Comfortable type, retaining monospace only for identifiers and source text. */
[data-theme] .view .page-head .sub { font-size: 16px; line-height: 1.6; max-width: 76ch; }
[data-theme] .view .eyebrow { font: 600 11px/1.5 var(--font); letter-spacing: .1em; }
[data-theme] .view .section-head h2 { font: 700 19px/1.4 var(--font); letter-spacing: -.015em; text-transform: none; white-space: normal; color: var(--text); }
[data-theme] .view .section { margin-bottom: 34px; }
[data-theme] .view .section .intro { font-size: 15px; line-height: 1.6; }
[data-theme] .view .btn { font-size: 14px; padding: 9px 13px; border-radius: 7px; min-height: 38px; }
[data-theme] .view .btn.tiny { font-size: 13px; padding: 6px 10px; min-height: 32px; }
[data-theme] .view :is(.input, .select) { font-size: 14px; border-radius: 7px; min-height: 40px; }
[data-theme] .view :is(.card, .chart-box, .table-wrap, .notice) { border-radius: 10px; box-shadow: none; }
[data-theme] .view :is(.card-head h3, .chart-cap) { font-size: 16px; }
[data-theme] .view :is(.card-sub, .chart-cap small, .small, .hint-line, .highlight p.muted, .nav-card p, .insight p) { font-size: 14px; line-height: 1.6; }
[data-theme] .view :is(.card-foot, .provenance, .legend-hint, .chart-actions .btn, .export-btns .btn, .section-count) { font-family: var(--font); font-size: 13px; line-height: 1.6; }
[data-theme] .view :is(.section-link, .legend, .legend-row, .notice, .tab, .filter-strip) { font-size: 14px; }
[data-theme] .view :is(.pill, .tag, .chip small, .chip .muted) { font-family: var(--font); font-size: 12px; letter-spacing: 0; border-radius: 5px; }
[data-theme] .people-table .pill { font-size: 13px; }
[data-theme] .view :is(.kv dt, .kv dd, .facts li, .fact-row) { font-size: 14px; line-height: 1.6; }
[data-theme] .view :is(.rel-group h4, .sub-group h5, .f-row > span, .rel-step) { font-family: var(--font); font-size: 13px; letter-spacing: 0; text-transform: none; }
[data-theme] .view .plink { border-bottom: 0; color: var(--accent-ink); text-decoration: none; }
[data-theme] .view .plink:hover { text-decoration: underline; text-underline-offset: 3px; }
[data-theme] .view a:focus-visible,
[data-theme] .view button:focus-visible,
[data-theme] .view summary:focus-visible,
[data-theme] .view th:focus-visible { outline: 2px solid var(--accent-ink); outline-offset: 3px; }
/* Overview: four anchors, four supporting figures, then discoveries. */
[data-theme] body[data-view="overview"] .grid.stats:not(.compact) { grid-template-columns: repeat(4, minmax(0, 1fr)); border-radius: 10px; margin-bottom: 16px; }
[data-theme] .stat { position: relative; padding: 22px; gap: 9px; }
[data-theme] .stat-label { font: 600 14px/1.4 var(--font); letter-spacing: 0; text-transform: none; color: var(--muted); padding-right: 16px; }
[data-theme] .stat-sub { font-size: 13px; line-height: 1.5; }
[data-theme] a.stat::after { content: '↗'; position: absolute; right: 16px; top: 18px; color: var(--accent-ink); font: 18px/1 var(--font); }
[data-theme] .view a.stat:focus-visible { outline-offset: -3px; }
[data-theme] .grid.stats.compact { gap: 12px; }
[data-theme] .grid.stats { border-radius: 10px; }
[data-theme] body[data-view="overview"] .grid.stats.compact.featured { grid-template-columns: repeat(4, minmax(0, 1fr)); }
[data-theme] .grid.stats.compact .stat { border-radius: 9px; background: var(--panel); padding: 18px; gap: 6px; }
[data-theme] .grid.stats.compact .stat-value { font-size: 26px; padding-right: 18px; }
[data-theme] .grid.stats.compact .stat-label { font-size: 14px; }
[data-theme] .grid.stats.compact .stat-sub { font: 13px/1.5 var(--font); }
[data-theme] .metric-details > summary { width: fit-content; cursor: pointer; color: var(--accent-ink); font-size: 14px; font-weight: 600; padding: 9px 0; }
[data-theme] .metric-details[open] > summary { margin-bottom: 10px; }
.detail-count { margin-left: 8px; color: var(--muted); font-size: 12px; font-weight: 400; }
[data-theme] .file-notes { margin: -2px 0 25px; border-block: 1px solid var(--panel-border); font-size: 13px; color: var(--muted); }
[data-theme] .file-notes > summary { cursor: pointer; padding: 12px 0; line-height: 1.7; }
[data-theme] .file-notes > summary strong { color: var(--text); font-weight: 600; margin-right: 12px; }
[data-theme] .file-note-details { padding-bottom: 16px; }
[data-theme] .file-note-details .notice { font-size: 14px; }
[data-theme] .grid.highlights,
[data-theme] .grid.insights { grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: stretch; gap: 16px; }
[data-theme] .highlight { display: flex; flex-direction: column; padding: 22px; }
[data-theme] .highlight .card-head { align-items: start; min-height: 42px; margin-bottom: 10px; }
[data-theme] .highlight .card-head h3,
[data-theme] .record .card-head h3 { font: 600 14px/1.5 var(--font); letter-spacing: 0; text-transform: none; color: var(--muted); }
[data-theme] .hl-value { font-size: 30px; line-height: 1.2; margin: 0 0 16px; }
[data-theme] .hl-value.long { font-size: 22px; }
[data-theme] .highlight .chips { margin-bottom: 8px; }
[data-theme] .highlight .chip { font-size: 13px; }
.card-action { display: flex; gap: 10px; align-items: center; font-size: 13px; font-weight: 600; color: var(--accent-ink); margin-top: auto; padding-top: 18px; }
.card-action .ui-icon { width: 16px; height: 16px; }
[data-theme] .insight { gap: 14px; padding: 22px; }
[data-theme] .insight .insight-title { font-size: 17px; line-height: 1.5; }
[data-theme] .insight .card-foot { padding-top: 14px; }
[data-theme] .insight .card-action { margin-top: 0; padding-top: 0; }
[data-theme] .stat .stat-value { color: var(--text); }
/* People: a real scroll container keeps headers fixed during long lists. */
[data-theme] table.table { font-size: 14px; }
[data-theme] table.table th { font: 600 13px/1.5 var(--font); letter-spacing: 0; text-transform: none; z-index: 2; }
[data-theme] table.table :is(th, td) { padding: 13px 14px; }
[data-theme] .table-foot { font-size: 13px; padding: 12px 14px; }
[data-theme] .people-table { max-height: min(70vh, 900px); overflow: auto; scrollbar-gutter: stable; }
[data-theme] .people-table .table { min-width: 820px; }
[data-theme] .people-table th { box-shadow: 0 1px 0 var(--panel-border); }
[data-theme] .people-table .person-name-col { min-width: 180px; max-width: 270px; font-weight: 600; }
[data-theme] .people-table .event-col { text-align: left; min-width: 165px; max-width: 230px; }
.person-event { display: grid; gap: 4px; }
.event-date { font-variant-numeric: tabular-nums; }
.place-detail { min-width: 0; font-size: 13px; color: var(--muted); }
.place-detail summary { display: flex; align-items: center; gap: 5px; cursor: pointer; list-style: none; }
.place-detail summary::before { content: '›'; flex: none; font-size: 16px; line-height: 1; }
.place-detail[open] summary::before { transform: rotate(90deg); }
.place-detail summary span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.place-full { padding: 8px 0 0 12px; white-space: normal; overflow-wrap: anywhere; line-height: 1.6; }
.column-picker { position: relative; margin-left: auto; }
.column-picker summary, .action-menu summary { list-style: none; }
.column-picker summary::-webkit-details-marker, .action-menu summary::-webkit-details-marker, .place-detail summary::-webkit-details-marker { display: none; }
.column-picker summary::after, .action-menu summary::after { content: '⌄'; margin-left: 5px; }
.column-options, .action-menu-panel { position: absolute; right: 0; top: calc(100% + 8px); min-width: 240px; z-index: 12; background: var(--panel-solid); border: 1px solid var(--line-strong); border-radius: 10px; padding: 10px; box-shadow: var(--shadow); }
.column-options { display: grid; gap: 3px; max-height: 55vh; overflow: auto; }
.column-options .check { padding: 7px 9px; font-size: 14px; }
.column-options .check:hover { background: var(--hover); border-radius: 5px; }
/* Profile and biography. Fifteen-pixel reading text is intentional. */
[data-theme] .grid.profile { align-items: start; gap: 20px; margin-bottom: 34px; }
[data-theme] .person-header { column-gap: 18px; row-gap: 20px; margin-bottom: 30px; }
[data-theme] .person-title h1 { line-height: 1.2; }
[data-theme] .person-actions { flex-basis: 100%; gap: 10px; }
[data-theme] .avatar { border-radius: 12px; }
.action-menu { position: relative; margin-left: auto; }
.action-menu-group { display: grid; gap: 4px; }
.action-menu-group + .action-menu-group { margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--panel-border); }
.action-menu-panel .btn { justify-content: flex-start; text-align: left; border-color: transparent; white-space: normal; }
[data-theme] .view .bio-article { font-size: 15px; line-height: 1.75; max-width: 68ch; }
[data-theme] .view .bio-lede { font-size: 17px; line-height: 1.65; }
[data-theme] .view .bio-quote { font-size: 14px; }
[data-theme] .view .bio-kicker { font-family: var(--font); font-size: 11px; letter-spacing: .08em; }
[data-theme] .bio-embed { background: var(--panel); padding: 28px 30px; border: 1px solid var(--panel-border); border-radius: 10px; }
[data-theme] .profile-bio-layout { display: grid; grid-template-columns: minmax(0, 68ch) minmax(160px, 1fr); gap: 40px; align-items: start; }
.bio-toc { display: grid; gap: 4px; border-left: 1px solid var(--panel-border); padding-left: 22px; position: sticky; top: 24px; }
.bio-toc strong { font-size: 13px; color: var(--muted); padding-bottom: 8px; }
.bio-toc button { background: none; border: 0; color: var(--muted); text-align: left; font: 13px/1.5 var(--font); cursor: pointer; padding: 6px 0; }
.bio-toc button:hover { color: var(--accent-ink); text-decoration: underline; }
.bio-embed .bio-chapter { scroll-margin-top: 24px; }
/* One chart type system, quieter boundaries, and consistent category hues. */
[data-theme] svg.chart { font-family: var(--font); }
[data-theme] .chart-body > svg.chart { min-width: 280px; }
[data-theme] svg.chart text { font-size: 12px; }
[data-theme] svg.chart.donut { max-width: 440px; margin: 0 auto; }
[data-theme] svg.chart.donut .donut-center { font-size: 24px; font-weight: 700; fill: var(--text); }
[data-theme] svg.chart.donut .donut-legend text { font-size: 13px; }
[data-theme] svg.chart.donut path { stroke: var(--panel-solid); stroke-width: 1.5px; }
[data-theme] svg.chart.line > path[fill="none"] { stroke-width: 2.5px; }
@media (max-width: 1200px) {
[data-theme] .grid.highlights { grid-template-columns: repeat(2, minmax(0, 1fr)); }
[data-theme] .profile-bio-layout { grid-template-columns: minmax(0, 1fr); gap: 22px; }
.bio-toc { position: static; order: -1; border-left: 0; border-bottom: 1px solid var(--panel-border); padding: 0 0 16px; display: flex; flex-wrap: wrap; gap: 6px 18px; }
.bio-toc strong { flex-basis: 100%; padding-bottom: 0; }
}
@media (max-width: 1050px) {
[data-theme] body[data-view="overview"] .grid.stats:not(.compact),
  [data-theme] body[data-view="overview"] .grid.stats.compact.featured { grid-template-columns: repeat(2, minmax(0, 1fr)); }
[data-theme] .grid.insights { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 620px) {
[data-theme] .grid.highlights, [data-theme] .grid.insights { grid-template-columns: minmax(0, 1fr); }
[data-theme] .grid.profile { grid-template-columns: minmax(0, 1fr); }
[data-theme] .view .page-head .sub { font-size: 15px; }
[data-theme] .stat { padding: 18px 14px; }
[data-theme] .stat-value { font-size: 32px; }
[data-theme] .stat-label { font-size: 13px; }
[data-theme] .grid.stats.compact .stat { padding: 15px; }
[data-theme] .bio-embed { padding: 22px 18px; }
[data-theme] .file-notes > summary span { display: block; }
[data-theme] .person-title { flex-basis: 220px; }
[data-theme] .person-title h1 { font-size: 28px; }
.action-menu { margin-left: 0; }
.action-menu-panel { left: 0; right: auto; min-width: 250px; max-width: calc(100vw - 40px); }
.column-options { min-width: 220px; }
}
@media (max-width: 380px) {
[data-theme] body[data-view="overview"] .grid.stats:not(.compact),
  [data-theme] body[data-view="overview"] .grid.stats.compact.featured { grid-template-columns: minmax(0, 1fr); }
}
@media print {
.metric-details > .grid { display: grid; }
.bio-toc, .column-picker, .action-menu { display: none; }
[data-theme] .people-table { max-height: none; overflow: visible; }
}
