.community-panel {
	--chart-height: 13.5rem;
	--chart-baseline: 2rem;
	--heat-color: #b54c15;
}

:root[data-theme='light'] .community-panel { --heat-color: #ffaa62; }

.community-source { color: var(--muted); font-size: .84rem; line-height: 1.5; }
.community-note { margin-top: .8rem; color: var(--muted); font-size: .9rem; line-height: 1.55; }
.community-state { padding: 1.35rem 0; color: var(--muted); line-height: 1.55; }
.community-distribution-notes { display: grid; gap: .25rem; margin-top: 1rem; }
.community-distribution-notes .community-note { margin: 0; }

.community-modes, .community-filters {
	display: flex;
	flex-wrap: wrap;
	align-items: end;
	gap: .5rem;
	margin-top: 1rem;
}

.community-modes { padding-bottom: .85rem; border-bottom: 1px solid var(--line); }
.community-modes button, .community-pagination button {
	padding: .54rem .75rem;
	font-size: .88rem;
}

.community-modes button[aria-pressed='true'] {
	background: color-mix(in srgb, var(--accent) 14%, var(--surface));
	color: var(--accent);
	border-color: color-mix(in srgb, var(--accent) 70%, var(--line));
}

.community-field { display: grid; gap: .3rem; min-width: min(100%, 13rem); }
.community-field span { color: var(--muted); font-size: .88rem; font-weight: 650; }
.community-field select { padding: .52rem .65rem; width: 100%; font-size: .92rem; }
.community-panel :is(button, select, summary, [tabindex]):focus-visible { outline-offset: 2px; }
.community-table:focus-visible, .community-heatmap-scroll:focus-visible, .community-plot-scroll:focus-visible {
	outline: 2px solid var(--accent);
}

.community-table table { min-width: 33rem; }
.community-table :is(th, td) { padding-inline: .65rem; white-space: nowrap; }
.community-table :is(th, td):is(:nth-child(2), :nth-child(3)) { text-align: left; }
.community-table tbody tr:hover { background: var(--soft); }
.community-table tbody td:last-child { color: var(--accent); font-weight: 750; }
.community-ranked-character { display: inline-flex; align-items: center; gap: .45rem; vertical-align: middle; }
.community-ranked-portrait { width: 2.75rem; height: 2.75rem; flex: none; }
.community-ranked-portrait img { display: block; width: 100%; height: 100%; object-fit: contain; image-rendering: pixelated; }
.community-profile-link {
	padding: .15rem .15rem .15rem 0;
	border: 0;
	background: transparent;
	color: var(--text);
	text-align: left;
}
.community-profile-link:hover { color: var(--accent); text-decoration: underline; }
.community-item { display: inline-flex; gap: .38rem; align-items: center; vertical-align: middle; }
.community-item img { margin-right: 0; width: 1.85rem; height: 1.85rem; flex: none; }
.community-pagination { display: flex; justify-content: flex-end; gap: .75rem; align-items: center; margin-top: .95rem; }
.community-pagination span { color: var(--muted); font-size: .85rem; font-variant-numeric: tabular-nums; }

.community-axis-labels {
	display: flex;
	flex-wrap: wrap;
	gap: .25rem 1rem;
	margin: 1rem 0 .55rem;
	color: var(--muted);
	font-size: .85rem;
	line-height: 1.5;
}
.community-axis-labels strong { color: var(--text); }
.community-filters + :is(.community-histogram, .community-heatmap-scroll) { margin-top: .95rem; }
.community-chart { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: .6rem; padding: 0 .45rem; }
.community-axis {
	display: flex;
	justify-content: space-between;
	align-items: flex-end;
	flex-direction: column;
	height: calc(var(--chart-height) + 1em);
	font-size: .78rem;
	line-height: 1;
	color: var(--muted);
	font-variant-numeric: tabular-nums;
}

.community-plot-scroll { overflow-x: auto; padding-top: .4rem; }
.community-plot {
	position: relative;
	height: var(--chart-height);
	margin-bottom: var(--chart-baseline);
	border-bottom: 1px solid var(--line);
	background: repeating-linear-gradient(to bottom, var(--line) 0 1px, transparent 1px 25%);
}

.community-column { display: flex; position: absolute; inset-block: 0; align-items: end; justify-content: center; }
.community-bar {
	display: block;
	width: min(75%, 3rem);
	border-radius: .25rem .25rem 0 0;
	background: linear-gradient(180deg, var(--accent), color-mix(in srgb, var(--accent) 62%, var(--action)));
}
.community-column:hover .community-bar { filter: brightness(1.2); }
.community-tick-label {
	position: absolute;
	top: calc(100% + .35rem);
	color: var(--muted);
	font-size: .78rem;
	font-variant-numeric: tabular-nums;
	white-space: nowrap;
}
.community-chart-data { margin-top: .8rem; }
.community-chart-data .community-table table { min-width: 17rem; }

.community-frequency { display: grid; gap: .6rem; margin: 0; padding: 0; list-style: none; }
.community-frequency li {
	display: grid;
	grid-template-columns: minmax(8rem, 1.2fr) minmax(2rem, 3fr) minmax(7rem, 1fr);
	align-items: center;
	gap: .8rem;
	margin: 0;
	padding: .28rem 0;
	font-size: .9rem;
}
.community-frequency-track, .community-frequency-track span { display: block; height: .57rem; border-radius: 1rem; }
.community-frequency-track { background: var(--soft); }
.community-frequency-track span { background: var(--accent); }
.community-frequency-value { color: var(--muted); text-align: right; font-variant-numeric: tabular-nums; }

.community-heatmap-scroll { overflow: auto; border: 1px solid var(--line); border-radius: .55rem; }
.community-heatmap { width: 100%; border-collapse: separate; border-spacing: 0; font-size: .88rem; }
.community-heatmap :is(th, td) {
	border-bottom: 1px solid var(--line);
	border-right: 1px solid var(--line);
	padding: .55rem .64rem;
	text-align: right;
	white-space: nowrap;
}
.community-heatmap tr > :first-child { position: sticky; left: 0; text-align: start; background: var(--surface); }
.community-heatmap :is(thead th, thead th:first-child) { background: var(--soft); }
.community-heatmap tr > :last-child { border-right: 0; }
.community-heatmap tbody tr:last-child > * { border-bottom: 0; }
.community-heatmap td {
	background: color-mix(in srgb, var(--heat-color) var(--heat-intensity), var(--surface));
	font-variant-numeric: tabular-nums;
}
.community-heatmap small { display: block; color: var(--muted); font-size: .75rem; margin-top: .13rem; }

@media (max-width: 36rem) {
	.community-frequency li { grid-template-columns: minmax(5.7rem, 1.5fr) minmax(1.5rem, 2fr) max-content; gap: .4rem; }
	.community-field { flex: 1 1 10rem; }
	.community-chart { padding: 0; }
}
