/* search: the header button, and the overlay it and "/" open */
.search-open { flex: none; gap: var(--space-2); color: var(--muted); }
.search-open[hidden] { display: none; }
.search-open kbd { border: 0; padding: 0; background: none; color: var(--faint); }
#search { position: fixed; inset: 0; z-index: 20; background: var(--scrim); }
#search .search-box { position: absolute; top: max(8px, 8vh); left: 50%; transform: translateX(-50%); width: min(680px, calc(100vw - 16px)); background: var(--raised); border: var(--hairline) solid var(--border); padding: var(--space-2); box-shadow: var(--shadow); }
#search input { width: 100%; font: var(--fw-regular) var(--text-lg) var(--sans); padding: var(--space-2) var(--space-3); border: var(--hairline) solid var(--border-strong); background: var(--bg); color: var(--fg); }
#search input:focus, #finder input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 var(--hairline) var(--accent); }
#search ol { list-style: none; margin: var(--space-1) 0 0; padding: 0; max-height: 65vh; overflow: auto; }
#search li.group { margin: var(--space-2) 0 var(--space-half); padding: var(--space-1) var(--space-2); font-size: var(--text-sm); font-weight: var(--fw-medium); color: var(--fg); background: var(--tint); border-block: var(--hairline) solid var(--border); }
#search li.group span { font: var(--fw-regular) var(--text-xs) var(--mono); color: var(--faint); margin-left: var(--space-1); }
#search li a { display: block; padding: var(--space-1) var(--space-2); color: var(--fg); }
#search li a:hover { background: var(--hover); text-decoration: none; }
#search li.sel a, #search li.sel button { background: var(--hover); box-shadow: inset 2px 0 0 var(--accent); }
#search .t, #search .m { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#search .t.mono { font-size: var(--text-sm); }
#search .m.mono { white-space: pre; }
#search .m { font-size: var(--text-xs); color: var(--muted); }
#search b { color: var(--link); font-weight: var(--fw-strong); }
#search li.more button { min-height: 0; border: 0; background: none; padding: var(--space-1) var(--space-2); width: 100%; justify-content: flex-start; color: var(--link); }
#search li.note { padding: var(--space-1) var(--space-2); font-size: var(--text-sm); color: var(--muted); }
#search .hint { margin: var(--space-2) var(--space-2) var(--space-half); font-size: var(--text-sm); color: var(--muted); }
#search .hint:empty { display: none; }
/* file finder */
#finder { position: fixed; top: 10%; left: 50%; transform: translateX(-50%); z-index: 20; width: min(640px, 94vw); background: var(--raised); border: var(--hairline) solid var(--border); padding: var(--space-2); box-shadow: var(--shadow); }
#finder input { width: 100%; font: var(--fw-regular) var(--text-md) var(--mono); padding: var(--space-2); border: var(--hairline) solid var(--border-strong); background: var(--bg); color: var(--fg); }
#finder ol { list-style: none; margin: var(--space-2) 0 0; padding: 0; max-height: 60vh; overflow: auto; }
#finder li a { display: block; padding: var(--space-1) var(--space-2); font-family: var(--mono); font-size: var(--text-sm); color: var(--fg); }
#finder li.sel a { background: var(--hover); box-shadow: inset 2px 0 0 var(--accent); }
#finder li b { color: var(--link); }
/* insights (insights.ts): the chart colours are tokens (--viz-*, checked
   for colour-blind readers against both pages); text keeps the page's own. */
.insights .ins-meta { margin: var(--space-1) 0 var(--space-4); }
/* The totals: tiles in one panel, a hairline between them. */
.insights .kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: var(--hairline); background: var(--border); }
.insights .kpis:empty { display: none; }
.insights .kpi { background: var(--raised); padding: var(--space-3); }
.insights .kpi .label { font-size: var(--text-sm); color: var(--muted); }
.insights .kpi .value { font: var(--fw-medium) var(--text-xl)/1.2 var(--mono); margin-top: var(--space-1); font-variant-numeric: tabular-nums; }
.insights .kpi .sub { color: var(--muted); font-size: var(--text-sm); }
/* Each chart is a panel: its name and what it counts in the head strip,
   the plot, then its table folded. */
.insights .charts { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 440px), 1fr)); gap: var(--space-4); margin: 0 0 var(--space-4); }
.insights figure.panel { margin: 0; position: relative; }
/* A repo's activity grid: a chart panel as wide as the page, over them. */
.insights figure.activity-panel { margin-bottom: var(--space-4); }
.insights .plot { position: relative; margin: var(--space-3) var(--space-3) 0; }
.insights .plot:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.insights svg { display: block; width: 100%; overflow: visible; font: var(--fw-regular) var(--text-xs) var(--mono); font-variant-numeric: tabular-nums; }
.insights svg .grid { stroke: var(--viz-grid); stroke-width: 1; shape-rendering: crispEdges; }
.insights svg .base { stroke: var(--viz-axis); stroke-width: 1; shape-rendering: crispEdges; }
.insights svg .tick { fill: var(--muted); }
.insights svg .s1 { fill: var(--viz-1); }
.insights svg .fail { fill: var(--viz-fail); }
.insights svg .dot { stroke: var(--raised); stroke-width: 2; }
.insights svg .line { fill: none; stroke: var(--viz-1); stroke-width: 1.5; stroke-linejoin: round; }
.insights svg .hair { stroke: var(--muted); stroke-width: 1; shape-rendering: crispEdges; }
.insights svg .on { filter: brightness(1.15); }
.insights svg .mark-label { fill: var(--fg); paint-order: stroke; stroke: var(--raised); stroke-width: 3px; stroke-linejoin: round; }
.insights .empty-chart { color: var(--muted); font-size: var(--text-sm); padding: var(--space-8) 0; text-align: center; }
.insights .legend { display: flex; gap: var(--space-4); font-size: var(--text-sm); color: var(--muted); margin: var(--space-1) var(--space-3) 0; }
.insights .legend i { display: inline-block; width: 10px; height: 10px; margin-right: var(--space-1); vertical-align: -1px; }
.insights .tip { position: absolute; z-index: 2; pointer-events: none; background: var(--raised); border: var(--hairline) solid var(--border); box-shadow: var(--shadow); padding: var(--space-1) var(--space-2); font-size: var(--text-sm); white-space: nowrap; }
.insights .tip b { font-size: var(--text-md); }
.insights .tip .k { display: inline-block; width: 10px; height: 2px; margin-right: var(--space-2); vertical-align: middle; }
.insights details.table { margin-top: var(--space-2); padding: var(--space-2) var(--space-3); border-top: var(--hairline) solid var(--border); font-size: var(--text-sm); }
.insights details.table summary { color: var(--muted); cursor: pointer; font-weight: var(--fw-medium); }
.insights details.table table { border-collapse: collapse; margin-top: var(--space-1); font-variant-numeric: tabular-nums; }
.insights details.table td, .insights details.table th { padding: var(--space-half) var(--space-3) var(--space-half) 0; text-align: left; border-bottom: var(--hairline) solid var(--border); }
.insights details.table th { font-weight: var(--fw-medium); color: var(--muted); }
.insights details.table .scroll { max-height: 240px; overflow: auto; }
.insights .data td.mono { font-size: var(--text-sm); }
.insights pre.cmd { margin: 0; overflow-x: auto; white-space: pre; padding: var(--space-3); border-top: var(--hairline) solid var(--border); font-size: var(--text-sm); }
@media (forced-colors: active) {
	.insights svg .s1, .insights svg .fail { fill: CanvasText; }
	.insights svg .line { stroke: CanvasText; }
}
footer.site .keyhelp { min-height: 0; background: none; border: 0; padding: 0; color: var(--muted); }
footer.site .keyhelp:hover { color: var(--fg); background: none; }
@media (pointer: coarse) and (hover: none) { footer.site .keyhelp { display: none; } }
/* keyboard shortcuts (keys.ts) */
#help { width: min(440px, 94vw); padding: 0; background: var(--raised); color: var(--fg); border: var(--hairline) solid var(--border); box-shadow: var(--shadow); }
#help:focus { outline: none; }
#help::backdrop { background: var(--scrim); }
#help > div { padding: var(--space-4) var(--space-5); }
#help h2 { margin: 0 0 var(--space-1); }
#help table { width: 100%; border-collapse: collapse; font-size: var(--text-sm); }
#help td { padding: var(--space-1) 0; vertical-align: top; border-bottom: var(--hairline) solid var(--border); }
#help td:first-child { width: 1%; padding-right: var(--space-4); white-space: nowrap; }
#help kbd { color: var(--fg); }
#help p { margin: var(--space-3) 0 0; font-size: var(--text-sm); }