.bs-section {
	background: #fff;
	border: 1px solid #ddd;
	border-radius: 12px;
	padding: 10px;
	margin: 14px auto;
	box-shadow: 0 3px 8px rgba(0,0,0,0.50);
}
.bs {
	font-size: 0.9rem;
	line-height: 1.5;
}
h2.bs {
	font-size: 1.3rem;
	line-height: 1.5;
}
.bs h3 {
	margin: 1rem 0 .5rem;
	font-size: 1.1rem;
	text-transform: none;
	color: #4d4d4d;
}
p.bs-subtle {
	font-size: 1rem;
	text-align: center;
	margin-bottom: .75rem;
	opacity: .8;
}
.bs-metrics .bs-metric:nth-child(1) { grid-area: tTotal; }
.bs-metrics .bs-metric:nth-child(2) { grid-area: pTotal; }
.bs-metrics .bs-metric:nth-child(3) { grid-area: uTotal; }
.bs-metrics .bs-metric:nth-child(4) { grid-area: tAvg; }
.bs-metrics .bs-metric:nth-child(5) { grid-area: pAvg; }
.bs-metrics .bs-metric:nth-child(6) { grid-area: uAvg; }
.bs-metrics {
	display: grid;
	grid-template-columns: repeat(3, minmax(0,1fr));
	gap: .5rem 1rem;
	grid-template-areas:
		"tTotal pTotal uTotal"
		"tAvg   pAvg   uAvg";
}
.bs-metric {
	display: grid;
	grid-template-columns: 1fr auto;
	align-items: center;
	font-size: 0.9rem;
	border: 1px solid #dcdcdc;
	border-radius: 6px;
	padding: .3rem .75rem;
	background: #fff;
	box-shadow: 3px 0 6px rgba(0,0,0,0.20);
	opacity: .9;
}
.bs-metric .label { opacity: .8; }
.bs-metric .value { font-weight: 600; }
.bs-panel { padding: 0; }

.bs-modebar {
	display: flex;
	justify-content: center;
	align-items: center;
	padding: .75rem 1rem;
}
.bs-modebar__group {
	display: flex;
	gap: .5rem;
	flex-wrap: wrap;
}
.bs-btn {
	display: inline-block;
	padding: .5rem 1rem;
	border: 1px solid rgba(0,0,0,.2);
	border-radius: .375rem;
	text-decoration: none;
	font-size: 0.9rem;
	line-height: 1;
	box-shadow: 3px 0 6px rgba(0,0,0,0.20);
}
.bs-btn:hover {
	background: #f2f2f2;
	text-decoration: none;
	box-shadow: 3px 0 6px rgba(0,0,0,0.30);
}
.bs-btn.is-active {
	background: #5aaadb;
	color: #fff;
	font-weight: 600;
	border-color: #5aaadb;
}
.bs-btn:focus-visible {
	outline: 2px solid #5aaadb;
	outline-offset: 2px;
}
.bs-panel > .inner { padding: 1rem; }
.bs-row {
	display: grid;
	grid-template-columns: 1.2fr 2fr .8fr .8fr; /* day | bar | count | pct */
	gap: .2rem 1rem;
	align-items: center;
	padding: .2rem 0;
	border-bottom: 1px solid #d9d9d9;
}
.bs-row-head {
	display: grid;
	grid-template-columns: 1.2fr 2fr .8fr .8fr;
	column-gap: 1rem;
	font-weight: 600;
	opacity: .8;
}
.bs-row-head .cell.align-right {
	text-align: right;
	font-variant-numeric: tabular-nums;
}
.bs-row.is-max { font-weight: 600; }
.bs-row .cell.align-right {
	text-align: right;
	font-variant-numeric: tabular-nums;
}
.bs-row .cell.grow {
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	padding-left: 5px;
}
.bs-row .cell.grow.cap { text-transform: capitalize; }
.bs-row .cell.bar { display: flex; align-items: center; }
.bs-row .cell.bs-time { display: flex; align-items: center; }
.bs-row .cell,
.bs-metrics > .bs-metric { min-width: 0; }
.bs-row .bar {
	width: 100%;
	height: 24px;
	border-radius: 9999px;
	background: #f2f5f8;
	overflow: hidden;
	box-shadow: inset 0 0 0 1px rgba(0,0,0,.15);
}
.bs-row .bar > span {
	display: block;
	height: 100%;
	max-width: 100%;
	box-sizing: border-box;
	border-radius: inherit;
	background: linear-gradient(to bottom, #aed5ed, #7bbbe2 70%, #5aaadb);
	background-clip: padding-box;
	transform: translateZ(0);
}
.bs-controls {
	display: flex;
	justify-content: center;
	font-size: 0.8rem;
	margin: .75rem 0;
	line-height: 2.5;
}
.bs-controls select {
	padding: 4px 8px;
	border-radius: 5px;
	border: solid 1px #808080;
	background-image: linear-gradient(to bottom, #FFFFFF 0%, #E9E9E9 100%);
	box-shadow: 0 0 0 1px #FFFFFF inset;
}
.bs-label-short { display: none; }
p.bs-footer-note {
	text-align: right;
	font-size: .8rem;
	opacity: .8;
}
.sr-only{position:absolute;width:1px;height:1px;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0;padding:0;}

.bs-month-nav {
	padding: 6px 10px;
	border: 1px solid #ddd;
	border-radius: 6px;
	font-size: 1.1em;
	line-height: 1.3;
	text-decoration: none;
	color: #333;
	background: #f8f8f8;
	transition: background .15s ease, border-color .15s ease, box-shadow .15s ease;
}
.bs-month-nav:hover { background: #f0f0f0; text-decoration: none; }
.bs-month-nav.disabled {
	opacity: .4;
	pointer-events: none;
	border-style: dashed;
}
.bs-month-select {
	padding: 6px 36px 6px 10px;
	border: 1px solid #ddd;
	border-radius: 6px;
	font-size: 1.1em;
	color: #333;
	background: #f8f8f8;
	line-height: 1.3;
	cursor: pointer;
}
.bs-month-select:focus {
	outline: none;
	border-color: #bbb;
	box-shadow: 0 0 0 3px rgba(0,0,0,0.06);
}
.bs-month-select:hover { background: #f0f0f0; }
.bs-month-select:disabled,
.bs-month-select:disabled:hover {
	background: #f8f8f8;
	opacity: .4;
	border-style: dashed;
	cursor: default;
	box-shadow: none;
}
.bs-month-select::-ms-expand { display: none; }
.bs-month-picker-bar {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 12px;
	margin-top: 10px;
	height: 30px;
}

/* Responsive mode - Basic Stats */
@media (max-width: 850px) {
	.bs-metrics {
		grid-template-columns: repeat(2, minmax(0,1fr));
		grid-template-areas:
			"tTotal tAvg"
			"pTotal pAvg"
			"uTotal uAvg";
	}
	.bs { font-size: 0.9rem; }
}
@media (max-width: 640px) {
	.bs-metrics {
		grid-template-columns: 1fr;
		grid-template-areas:
			"tTotal"
			"tAvg"
			"pTotal"
			"pAvg"
			"uTotal"
			"uAvg";
	}
	.bs-row-head,
	.bs-row {
		grid-template-columns:
			minmax(0, 1.2fr)
			minmax(0, 2fr)
			minmax(6.5ch, .8fr)
			minmax(5ch, .9fr);
		column-gap: .5rem;
	}
	.bs-row-head > .cell,
	.bs-row > .cell { min-width: 0; }
	.bs-row {
		grid-template-areas: none;
		align-items: center;
		padding: .2rem 0;
	}
	.bs-row .cell.day {
		grid-column: 1 / 3;
		grid-row: 1;
		white-space: normal;
		overflow-wrap: anywhere;
		text-overflow: clip;
		line-height: 1.25;
	}
	.bs-row .cell.count {
		grid-column: 3;
		grid-row: 1;
		justify-self: end;
		text-align: right;
		white-space: nowrap;
		padding: 0;
	}
	.bs-row .cell.pct {
		grid-column: 4;
		grid-row: 1;
		justify-self: end;
		text-align: right;
		white-space: nowrap;
		padding: 0;
	}
	.bs-row .cell.bar {
		grid-column: 1 / -1;
		grid-row: 2;
	}
	.bs-row .bar { height: 18px; }
	.bs-label-full { display: none; }
	.bs-label-short { display: inline; }
}

/* Dark mode - Basic Stats */
html.phpbb-dark-mode .bs-section {
	background: #0f141a;
	border: 1px solid #2a3240;
	border-radius: 12px;
	box-shadow: 0 3px 8px rgba(0,0,0,.7);
	color: #e5e7eb;
}
html.phpbb-dark-mode .bs { color: #e5e7eb; }
html.phpbb-dark-mode h2.bs,
html.phpbb-dark-mode .bs h3 { color: #f3f4f6; }
html.phpbb-dark-mode p.bs-subtle { color: #cbd5e1; opacity: .9; }

html.phpbb-dark-mode .bs-metric {
	border: 1px solid #334155;
	background: #111827;
	box-shadow: 3px 0 6px rgba(0,0,0,.35);
}
html.phpbb-dark-mode .bs-metric .label { opacity: .85; }
html.phpbb-dark-mode .bs-metric .value { color: #e5e7eb; }
html.phpbb-dark-mode .bs-modebar { color: #e5e7eb; }
html.phpbb-dark-mode .bs-btn {
	color: #e5e7eb;
	background: #111827;
	border: 1px solid rgba(255,255,255,.12);
	box-shadow: 3px 0 6px rgba(0,0,0,.35);
	text-decoration: none;
}
html.phpbb-dark-mode .bs-btn:hover {
	background: #1f2937;
	box-shadow: 3px 0 6px rgba(0,0,0,.5);
}
html.phpbb-dark-mode .bs-btn.is-active {
	background: #5aaadb;
	border-color: #5aaadb;
	color: #fff;
}
html.phpbb-dark-mode .bs-btn:focus-visible {
	outline: 2px solid #5aaadb;
	outline-offset: 2px;
}
html.phpbb-dark-mode .bs-row-head { color: #e5e7eb; opacity: .8; }
html.phpbb-dark-mode .bs-row { color: #e5e7eb; border-bottom: 1px solid #253040; }

html.phpbb-dark-mode .bs-row .bar {
	background: #1f2937;
	box-shadow: inset 0 0 0 1px rgba(255,255,255,.08);
}
html.phpbb-dark-mode .bs-row .bar > span {
	background: linear-gradient(to bottom, #60a5fa, #3b82f6 70%, #2563eb);
}
html.phpbb-dark-mode .bs-controls { color: #cbd5e1; }
html.phpbb-dark-mode .bs-controls select {
	color: #e5e7eb;
	background: #111827;
	border: 1px solid #334155;
	box-shadow: none;
}
html.phpbb-dark-mode .bs-month-nav {
	color: #e5e7eb;
	background: #111827;
	border: 1px solid #334155;
	transition: background .15s ease, border-color .15s ease, box-shadow .15s ease;
}
html.phpbb-dark-mode .bs-month-nav:hover { background: #1f2937; text-decoration: none; }
html.phpbb-dark-mode .bs-month-nav.disabled { opacity: .45; border-color: #334155; border-style: dashed; }

html.phpbb-dark-mode .bs-month-select {
	color: #e5e7eb;
	background: #111827;
	border: 1px solid #334155;
}
html.phpbb-dark-mode .bs-month-select:hover { background: #1f2937; }
html.phpbb-dark-mode .bs-month-select:focus {
	outline: none;
	border-color: #60a5fa;
	box-shadow: 0 0 0 3px rgba(59,130,246,.25);
}
html.phpbb-dark-mode .bs-month-select:disabled,
html.phpbb-dark-mode .bs-month-select:disabled:hover {
	background: #0b1016;
	border-color: #334155;
	opacity: .4;
	border-style: dashed;
	cursor: default;
	box-shadow: none;
}
html.phpbb-dark-mode p.bs-footer-note { color: #94a3b8; }
html.phpbb-dark-mode .bs .tabs .tab a { color: #e5e7eb; }