.tp-horarios-wrap {
	width: 100%;
	font-family: "Carmen Sans", sans-serif;
	box-sizing: border-box;
	--tp-label-width: 130px;
	--tp-col-min: 90px;
}
.tp-horarios-wrap * { box-sizing: border-box; }

.tp-title {
	font-size: var(--tp-font-title) !important;
	color: var(--tp-color-title) !important;
	font-weight: 700 !important;
	margin: 0 0 20px 0;
	text-align: center;
}
.tp-title .tp-arrow {
	margin: 0 10px;
	display: inline-block;
}

/* El propio .tp-table es el contenedor con scroll horizontal en pantallas chicas */
.tp-table {
	width: 100%;
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
}

.tp-header-row {
	display: flex;
	align-items: stretch;
	gap: 8px;
	margin-bottom: 8px;
}
.tp-header-spacer {
	flex: 0 0 var(--tp-label-width);
	position: sticky;
	left: 0;
	z-index: 2;
}
.tp-header-cells {
	flex: 1 1 auto;
	display: grid;
	grid-template-columns: repeat(var(--tp-cols, 5), minmax(var(--tp-col-min), 1fr));
	gap: 8px;
	min-width: calc(var(--tp-cols, 5) * var(--tp-col-min));
}
.tp-header-cell {
	background: var(--tp-color-header-bg);
	color: var(--tp-color-header-text);
	font-size: var(--tp-font-header);
	font-weight: 600;
	text-align: center;
	padding: 10px 8px;
	border-radius: 25px;
	display: flex;
	align-items: center;
	justify-content: center;
}

.tp-group {
	display: flex;
	align-items: stretch;
	gap: 8px;
	margin-bottom: 8px;
}
.tp-group + .tp-group {
	border-top: 1px solid #E2E2E2;
	padding-top: 18px;
	margin-top: 20px;
}

.tp-day-label {
	flex: 0 0 var(--tp-label-width);
	background: var(--tp-color-header-bg);
	color: var(--tp-color-header-text);
	font-size: var(--tp-font-header);
	font-weight: 700;
	text-align: center;
	padding: 10px;
	border-radius: 0 var(--tp-radius) 0 var(--tp-radius);
	display: flex;
	align-items: center;
	justify-content: center;
	position: sticky;
	left: 0;
	z-index: 2;
}

.tp-rows {
	flex: 1 1 auto;
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.tp-row {
	display: grid;
	grid-template-columns: repeat(var(--tp-cols, 5), minmax(var(--tp-col-min), 1fr));
	gap: 8px;
	align-items: center;
	min-width: calc(var(--tp-cols, 5) * var(--tp-col-min));
}

.tp-cell {
	font-size: var(--tp-font-cell);
	text-align: center;
	padding: 9px 10px;
	border-radius: 999px;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 4px;
	white-space: nowrap;
	min-height: 1em;
}
.tp-cell--muted {
	background: var(--tp-color-cell-bg);
	color: var(--tp-color-cell-text);
}
.tp-cell--highlight {
	background: var(--tp-color-cell-bg);
	border: 2px solid var(--tp-color-highlight);
	color: var(--tp-color-highlight);
	font-weight: 600;
}
.tp-cell--plain {
	background: transparent;
	color: var(--tp-color-cell-text);
	font-weight: 400;
}
/* Celda sin horario cargado: siempre en blanco, sin importar la columna */
.tp-cell--empty {
	background: transparent !important;
	border-color: transparent !important;
}

.tp-asterisk {
	font-size: 1.5em;
	font-weight: 700;
	line-height: 1;
	transform: translateY(-1px);
}

.tp-legend {
	display: flex;
	flex-wrap: wrap;
	gap: 18px;
	margin-top: 22px;
	justify-content: center;
}
.tp-legend-item {
	display: flex;
	align-items: center;
	gap: 8px;
	font-size: 13px;
	color: #555;
}
.tp-legend-pill {
	width: 26px;
	height: 16px;
	border-radius: 999px;
	flex: none;
}
.tp-legend-pill--highlight {
	background: transparent;
	border: 2px solid var(--tp-color-highlight);
}
.tp-legend-pill--muted {
	background: var(--tp-color-cell-bg);
}

@media (max-width: 640px) {
	.tp-horarios-wrap { --tp-label-width: 96px; --tp-col-min: 78px; }
	.tp-cell, .tp-header-cell { font-size: 11px; padding: 7px 5px; }
	.tp-day-label, .tp-header-cell { font-size: 11px; }
}
