/* === File: styles/charts.css === */

.jdoc-charts .chart-wrap {
	height: 220px;
	position: relative;
}
.jdoc-charts .chart-wrap.pie {
	height: 260px;
}
.jdoc-charts .chart-wrap.line {
	height: 260px;
}
.jdoc-charts .chart-wrap.line14 {
	height: 220px;
}

.jdoc-charts canvas {
	width: 100% !important;
	height: 100% !important;
	display: block;
}

.jdoc-charts .chart-empty {
	position: absolute;
	inset: 0;
	display: grid;
	place-items: center;
	pointer-events: none;
	font-weight: 800;
	font-size: 16px;
	font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
	opacity: 0.70;
}

.jdoc-week-nav {
	display: flex;
	gap: 10px;
	align-items: center;
	justify-content: space-between;
	margin-top: 10px;
}

.jdoc-week-nav button, .jdoc-week-nav span {
	display: inline-block;
	padding: 10px 12px;
	border-radius: 10px;
	border: 1px solid color-mix(in srgb, currentColor 18%, transparent);
	background: color-mix(in srgb, currentColor 6%, transparent);
	text-decoration: none;
	font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
	font-size: 12px;
	color: inherit;
}

.jdoc-week-nav button {
	cursor: pointer;
}
.jdoc-week-nav button:hover {
	background: color-mix(in srgb, currentColor 10%, transparent);
}

.jdoc-week-nav .mid {
	opacity: 0.78;
	border-style: dashed;
	text-align: center;
	flex: 1 1 auto;
	margin: 0 6px;
}

/* 356-day compact heatmap */
.jdoc-heatmap {
	--hm: 16px;
	--gap: 3px;
	display: grid;
	grid-template-columns: repeat(auto-fill, var(--hm));
	grid-auto-rows: var(--hm);
	gap: var(--gap);
	margin-top: 10px;
	padding: 0;
	border: 0;
	border-radius: 0;
	background: transparent;
}

.jdoc-heatmap .hm-cell {
	width: var(--hm);
	height: var(--hm);
	border: 0;
	border-radius: 2px;
	background: color-mix(in srgb, currentColor 5%, transparent);
}

.jdoc-heatmap .hm-cell[data-l="1"] {
	background: color-mix(in srgb, #00ff66 18%, transparent);
}
.jdoc-heatmap .hm-cell[data-l="2"] {
	background: color-mix(in srgb, #00ff66 32%, transparent);
}
.jdoc-heatmap .hm-cell[data-l="3"] {
	background: color-mix(in srgb, #00ff66 48%, transparent);
}
.jdoc-heatmap .hm-cell[data-l="4"] {
	background: color-mix(in srgb, #00ff66 66%, transparent);
}

.jdoc-charts .muted-mini {
	opacity: 0.75;
	font-size: 12px;
	margin-top: 8px;
	font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}

/* Top spans table */
.topspans-head {
	margin: 6px 0 10px;
}
.topspans-block {
	margin: 10px 0 14px;
}
.topspans-title {
	margin: 0 0 6px;
}

.topspans-table {
	width: 100%;
	border-collapse: collapse;
	font-size: 12px;
}
.topspans-table th,
.topspans-table td {
	padding: 6px 6px;
	border-bottom: 1px solid var(--rule);
	vertical-align: middle;
}
.topspans-table th {
	font-weight: 600;
	text-align: left;
}
.topspans-dot {
	display: inline-block;
	width: 10px;
	height: 10px;
	border-radius: 50%;
	margin-right: 8px;
	vertical-align: middle;
	border: 1px solid rgba(0, 0, 0, 0.18);
}
.topspans-table td.is-neg {
	font-weight: 700;
}
.topspans-table td.is-pos {
	font-weight: 700;
}

.dsum {
	font-size: 14px;
	font-weight: 600;
	margin-top: 6px;
	color: var(--muted);
	border-bottom: 1px solid var(--rule);
	padding-bottom: 16px;
	margin-bottom: 80px;
}
#jdocSince {
	margin-bottom: 80px;
}

/* Table-like legend: fixed “activity” column + flexible description column */
.dsum-legend {
	margin: 8px 0 12px;
	padding: 10px 12px;

	background: var(--paper);
	border: 1px solid var(--rule);
	border-radius: 10px;

	box-shadow: 0 1px 0 rgba(255, 255, 255, 0.03) inset, 0 -1px 0 rgba(0, 0, 0, 0.25) inset;
}

.dsum-legend .dsum-legend-title {
	display: block;
	font-size: 12px;
	font-weight: 850;
	letter-spacing: 0.2px;
	color: var(--ink);
	margin: 0 0 10px 0;
}

/* the “table” */
.dsum-legend ul {
	list-style: none;
	margin: 0;
	padding: 0;

	display: grid;
	grid-template-columns: max-content 1fr; /* key col / desc col */
	column-gap: 14px;
	row-gap: 8px;
}

/* key cell */
.dsum-legend .dsum-legend-key {
	display: flex;
	align-items: center;
	gap: 8px;

	font-size: 12px;
	font-weight: 800;
	color: var(--method-ink);
	white-space: nowrap;
}

/* desc cell */
.dsum-legend .dsum-legend-desc {
	font-size: 12px;
	font-weight: 650;
	line-height: 1.35;
	color: var(--muted);
	padding-top: 1px; /* baseline nudge */
}

/* optional row separators */
.dsum-legend ul > li {
	display: contents; /* lets the UL grid control alignment */
}

.dsum-legend ul > li:not(:first-child) .dsum-legend-key,
.dsum-legend ul > li:not(:first-child) .dsum-legend-desc {
	border-top: 1px dashed color-mix(in srgb, var(--rule) 70%, transparent);
	padding-top: 8px;
}

/* colored marker */
.dsum-legend .dsum-legend-dot {
	width: 10px;
	height: 10px;
	border-radius: 3px;
	background: var(--accent); /* override per item */
	box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.25) inset;
	flex: 0 0 auto;
}
