/* KPI internals */
.card .kpi {
	margin:0 0 30px 0;
}

/* KPI internals */
.card .kpi-value {
	font-size: 46px;
	font-weight:bold;
}
.card .kpi-title {
	display: inline;
	vertical-align: middle;
	font-size: 14px;
	color: #6b7280;
}

.kpi-row {
	display: grid;
	grid-auto-flow: column;
	grid-auto-columns: minmax(0, calc((100% - 24px) / 3));
	gap: 12px;
	overflow-x: auto;
	scroll-snap-type: x proximity;
	-webkit-overflow-scrolling: touch;
}

.kpi-row .card {
	scroll-snap-align: start;
}

@media (max-width: 900px) {
	.kpi-row {
		grid-auto-columns: minmax(0, calc((100% - 12px) / 2));
	}
}

@media (max-width: 640px) {
	.kpi-row {
		grid-auto-columns: minmax(0, 80%);
	}
}

/* Section header controls */
.section-head {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 16px;
	margin-bottom: 6px;
}

.section-actions {
	display: flex;
	gap: 8px;
}

/* Charts */
.chart {
	width: 100%;
	height: 280px;
}
.mini {
	width: 100%;
	height: 180px;
}
.tiny {
	width: 100%;
	height: 50px;
}
/* ... (Keep all previous styles until #backboneCards) ... */

/* ────────────────────────────────────────────────
   Cultural Backbone (KPI-style cards)
   ──────────────────────────────────────────────── */
#backboneCards {
	display: flex;
	flex-wrap: nowrap;
	gap: 12px;
	overflow-x: visible;
	padding: 0 0 6px;
	scroll-snap-type: x proximity;
	-webkit-overflow-scrolling: touch;
	scroll-behavior: smooth;
	overscroll-behavior-x: contain;
}

/* Line 1: Dot + Score (Left) ... Pill (Right) */
#backboneCards .bb-top {
	display: flex;
	justify-content: space-between; /* Push groups to edges */
	align-items: center;            /* Vertically center everything */
}

/* Left Group: Dot + Score */
#backboneCards .bb-top-left {
	display: flex;
	align-items: center; /* Center dot with score */
	gap: 8px;
}

/* Reset Dot positioning for this context */
#backboneCards .bb-top-left .dot {
	width: 10px;
	height: 10px;
	border-radius: 50%;
	display: inline-block;
	flex: 0 0 10px;
	position: static; /* Reset previous relative positioning */
	margin: 0;
	top: auto;
}

/* Score Text */
#backboneCards .bb-top-left .kpi-value {
	line-height: 1; /* Tighter line height for alignment */
	font-size: 60px;
}

/* Line 2 & 3: Title + Description */
#backboneCards .bb-main {
	margin-top: 8px;
	margin-bottom: 10px;
}

/* Title Override */
#backboneCards .bb-main .kpi-title {
	display: block;    /* Force new line */
	font-size: 20px;
	margin-bottom: 4px;
	color: #333;
	font-weight:bold;
}

/* General Card Styles */
#backboneCards .card {
	flex: 0 0 calc((100% - 24px) / 3);
	scroll-snap-align: start;
}

/* ───────────────────────────────
   Rows below (Behaviors / Workplace)
   ─────────────────────────────── */
#backboneCards .bb-row {
	display: grid;
	grid-template-columns: 1fr auto auto;
	gap: 8px;
	align-items: center;
	padding: 6px 0;
	border-top: 1px solid #f0f2f5;
}
#backboneCards .bb-row:first-of-type {
	border-top: none;
}

#backboneCards .bb-label {
	color: #111827;
	font-size: 0.9rem;
	line-height: 1.3;
}
#backboneCards .bb-value {
	color: #111827;
	text-align: right;
	min-width: 3.5ch;
	font-weight:bold;
}
#backboneCards .bb-delta {
	font-size: 12px;
	font-weight: 700;
	text-align: right;
	min-width: 6ch;
}

/* Delta colors */
#backboneCards .bb-delta.up   { color: #16a34a; }
#backboneCards .bb-delta.down { color: #dc2626; }
#backboneCards .bb-delta.flat,
#backboneCards .bb-delta.muted { color: #6b7280; }

/* Spacer Utility */
.bb-spacer {
	height: 12px;
}

/* Toggle button */
.bb-toggle{
	font-size: 12px !important;
	margin:0;
	display: inline-block;
	background: transparent;
	border: none;
	cursor: pointer;
	padding:0;
}
.bb-toggle:hover { text-decoration: underline; }

/* Collapsible details */
.bb-details.is-collapsed { display: none; }
.bb-details { margin-top: 6px; }

/* Mobile */
@media (max-width: 480px) {
	#backboneCards .bb-row {
		grid-template-columns: 1fr auto;
		grid-auto-flow: row dense;
	}
	#backboneCards .bb-value { order: 2; }
	#backboneCards .bb-delta { order: 3; }
}
