.lsgrid {
	--lsgrid-border: #e0e0e0;
	--lsgrid-header: #eef2f9;
	--lsgrid-text: #4a4a4a;
	--lsgrid-accent: #007bff;
	--lsgrid-error: #dc3545;
	color: var(--lsgrid-text);
	outline: none;
	max-width: 100%;
}

.lsgrid-scroll {
	position: relative;
	overflow: auto;
	border: 1px solid var(--lsgrid-border);
	border-radius: 8px;
}

.lsgrid-table {
	width: 100%;
	border-collapse: separate;
	border-spacing: 0;
	user-select: none;
}

.lsgrid-table th,
.lsgrid-table td {
	padding: 12px 8px;
	text-align: center;
	border-right: 1px solid var(--lsgrid-border);
	border-bottom: 1px solid var(--lsgrid-border);
	background: #fff;
	white-space: nowrap;
}

.lsgrid-table th:last-child,
.lsgrid-table td:last-child {
	border-right: 0;
}

.lsgrid-table tbody tr:last-child td {
	border-bottom: 0;
}

.lsgrid-table th {
	position: sticky;
	top: 0;
	z-index: 2;
	background: var(--lsgrid-header);
	font-weight: 500;
	cursor: pointer;
}

.lsgrid-table th.lsgrid-merged {
	border-bottom-color: transparent;
}

.lsgrid-table .lsgrid-frozen {
	position: sticky;
	z-index: 1;
}

.lsgrid-table th.lsgrid-frozen {
	z-index: 3;
}

.lsgrid-table .lsgrid-hidden {
	display: none;
}

.lsgrid-table td.lsgrid-readonly {
	background: var(--lsgrid-header);
	font-weight: 500;
}

.lsgrid-table td.lsgrid-disabled {
	background: repeating-linear-gradient(
		135deg,
		var(--lsgrid-header),
		var(--lsgrid-header) 6px,
		#e3e8f1 6px,
		#e3e8f1 12px
	);
	color: #9aa3b2;
	cursor: not-allowed;
}

.lsgrid-table td.lsgrid-selected {
	box-shadow: inset 0 0 0 9999px rgba(0, 123, 255, 0.08);
}

.lsgrid-table td.lsgrid-active {
	outline: 2px solid var(--lsgrid-accent);
	outline-offset: -2px;
}

.lsgrid:not(:focus):not(:focus-within) td.lsgrid-active {
	outline-color: #b8c4d6;
}

.lsgrid-table td.lsgrid-fill {
	outline: 1px dashed var(--lsgrid-accent);
	outline-offset: -1px;
}

.lsgrid-table td.lsgrid-invalid {
	outline: 2px solid var(--lsgrid-error);
	outline-offset: -2px;
}

.lsgrid-table td:empty::before {
	content: attr(data-placeholder);
	color: #9aa3b2;
}

.lsgrid-table td.lsgrid-editing {
	padding: 0;
}

.lsgrid-editor {
	width: 100%;
	min-width: 60px;
	padding: 12px 8px;
	border: 0;
	outline: 0;
	background: transparent;
	color: inherit;
	font: inherit;
	text-align: center;
	user-select: text;
}

.lsgrid-handle {
	display: none;
	position: absolute;
	width: 8px;
	height: 8px;
	background: var(--lsgrid-accent);
	border: 1px solid #fff;
	cursor: crosshair;
	z-index: 4;
}

.lsgrid-toolbar {
	display: flex;
	gap: 4px;
	margin-bottom: 6px;
}

.lsgrid-tool {
	display: inline-flex;
	padding: 4px;
	border: 1px solid transparent;
	border-radius: 4px;
	background: none;
	color: inherit;
	cursor: pointer;
}

.lsgrid-tool:hover,
.lsgrid-tool:focus-visible {
	border-color: var(--lsgrid-border);
	background: var(--lsgrid-header);
}

.lsgrid-status {
	display: flex;
	justify-content: space-between;
	gap: 16px;
	min-height: 1.4em;
	margin-top: 4px;
	font-size: 0.85em;
}

.lsgrid-message {
	color: var(--lsgrid-error);
}

.lsgrid-summary {
	margin-inline-start: auto;
	white-space: pre;
}

.lsgrid-table td.lsgrid-error {
	color: var(--lsgrid-error);
}

.lsgrid-table td.font-weight-bold {
	font-weight: 700;
}

.lsgrid-table td.font-italic {
	font-style: italic;
}
