/* =============================================
   Table Cell Merge – Editor Styles
   ============================================= */

/* --- Merge mode: block editing in cells --- */
.msm-table-merge-mode table {
	user-select: none;
}

.msm-table-merge-mode table td,
.msm-table-merge-mode table th {
	cursor: crosshair;
}

.msm-table-merge-mode table td *,
.msm-table-merge-mode table th * {
	pointer-events: none !important;
}

/* --- Selected cell highlight --- */
.msm-cell-selected {
	background-color: rgba(0, 120, 215, 0.22) !important;
	outline: 2px solid #0078d7 !important;
	outline-offset: -2px;
}

/* --- Merged cell indicator --- */
.msm-merged-cell {
	outline: 2px dashed #00a32a !important;
	outline-offset: -2px;
}

/* --- Hidden cell --- */
.msm-hidden-cell {
	display: none !important;
}


/* =============================================
   Mobile horizontal scroll
   ============================================= */
@media (max-width: 767px) {
	figure.msm-mobile-scroll {
		overflow-x: auto !important;
		-webkit-overflow-scrolling: touch;
	}

	figure.msm-mobile-scroll {
		border-radius: 0 !important;
	}

	figure.msm-mobile-scroll table {
		width: max-content !important;
		min-width: 100%;
		table-layout: auto !important;
		border-radius: var(--msm-radius, 0);
		overflow: clip;
	}

	figure.msm-mobile-scroll table td,
	figure.msm-mobile-scroll table th {
		white-space: nowrap;
	}

	/* --- Sticky first column (class-based, rowspan safe) --- */
	figure.msm-sticky-first-col table {
		border-collapse: separate !important;
		border-spacing: 0 !important;
	}

	figure.msm-sticky-first-col table td,
	figure.msm-sticky-first-col table th {
		border-top: none;
		border-left: none;
	}

	figure.msm-sticky-first-col table thead tr:first-child td,
	figure.msm-sticky-first-col table thead tr:first-child th,
	figure.msm-sticky-first-col table tbody:first-child tr:first-child td,
	figure.msm-sticky-first-col table tbody:first-child tr:first-child th {
		border-top-style: solid;
		border-top-width: 1px;
	}

	figure.msm-sticky-first-col table td:first-child,
	figure.msm-sticky-first-col table th:first-child {
		border-left-style: solid;
		border-left-width: 1px;
	}

	.msm-sticky-col {
		position: sticky !important;
		left: 0;
		z-index: 10 !important;
	}

	.msm-sticky-col::after {
		content: "";
		position: absolute;
		top: 0;
		right: -6px;
		bottom: 0;
		width: 6px;
		background: linear-gradient(to right, rgba(0, 0, 0, 0.06), transparent);
		pointer-events: none;
	}

	/* --- Scroll hint overlay --- */
	figure.msm-has-scroll-hint {
		position: relative;
	}

	.msm-scroll-hint {
		position: absolute;
		inset: 0;
		display: flex;
		flex-direction: column;
		align-items: center;
		justify-content: center;
		background: rgba(80, 80, 80, 0.75);
		z-index: 20;
		pointer-events: none;
		transition: opacity 0.4s ease;
		border-radius: var(--msm-radius, 0);
	}

	.msm-scroll-hint svg {
		display: block;
		margin-bottom: 8px;
	}

	.msm-scroll-hint__text {
		color: #fff;
		font-size: 13px;
		font-weight: 600;
		letter-spacing: 0.05em;
	}

	figure.msm-hint-hidden .msm-scroll-hint {
		opacity: 0;
		pointer-events: none;
	}
}
