.ec-lm {
	--ec-lm-accent: #217346;
	--ec-lm-btn: #E36C0A;
	--ec-lm-btn-ink: #ffffff;
	--ec-lm-ink: #3a3a3a;
	--ec-lm-line: #d9dcda;
	--ec-lm-chrome: #f2f2f2;
	--ec-lm-chrome-active: #d6d9d7;
	--ec-lm-chrome-ink: #5f6461;
	margin: 24px 0;
}

.ec-lm-form {
	font-family: Calibri, "Segoe UI", -apple-system, BlinkMacSystemFont, Arial, sans-serif;
}

.ec-lm-sheet {
	border: 1px solid var(--ec-lm-line);
	background: #fff;
	overflow: hidden;
}

/* Optional formula bar */

.ec-lm-fbar {
	display: flex;
	align-items: stretch;
	height: 28px;
	background: #fff;
	border-bottom: 1px solid var(--ec-lm-line);
}

.ec-lm-namebox {
	flex: 0 0 70px;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 12px;
	color: var(--ec-lm-ink);
	background: var(--ec-lm-chrome);
	border-right: 1px solid var(--ec-lm-line);
}

.ec-lm-fx {
	flex: 0 0 36px;
	display: flex;
	align-items: center;
	justify-content: center;
	color: var(--ec-lm-chrome-ink);
	border-right: 1px solid var(--ec-lm-line);
}

.ec-lm-fx em {
	font-family: "Times New Roman", Georgia, serif;
	font-style: italic;
	font-size: 15px;
}

.ec-lm-fx sub {
	font-size: 10px;
	font-style: italic;
}

.ec-lm-formula {
	flex: 1 1 auto;
	display: flex;
	align-items: center;
	padding: 0 9px;
	font-size: 14px;
	color: var(--ec-lm-ink);
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.ec-lm-formula.is-default {
	color: var(--ec-lm-chrome-ink);
}

/* Grid */

.ec-lm-grid {
	display: grid;
	grid-template-columns: 28px minmax(0, 2.1fr) minmax(0, 0.8fr) minmax(0, 1.1fr) minmax(0, 1.1fr);
	background: var(--ec-lm-line);
	gap: 1px;
}

.ec-lm-corner,
.ec-lm-colhead,
.ec-lm-rowhead {
	background: var(--ec-lm-chrome);
	color: var(--ec-lm-chrome-ink);
	font-size: 12px;
	display: flex;
	align-items: center;
	justify-content: center;
	user-select: none;
}

.ec-lm-colhead {
	height: 22px;
}

.ec-lm-colhead.is-active,
.ec-lm-rowhead.is-active {
	background: var(--ec-lm-chrome-active);
	color: #1a1a1a;
	box-shadow: inset 0 -2px 0 var(--ec-lm-accent);
}

.ec-lm-rowhead.is-active {
	box-shadow: inset -2px 0 0 var(--ec-lm-accent);
}

.ec-lm-corner {
	position: relative;
}

.ec-lm-corner::after {
	content: "";
	position: absolute;
	right: 2px;
	bottom: 2px;
	width: 0;
	height: 0;
	border-style: solid;
	border-width: 0 0 9px 9px;
	border-color: transparent transparent #b6bab8 transparent;
}

.ec-lm-cell {
	background: #fff;
	display: flex;
	align-items: center;
	min-width: 0;
	min-height: 40px;
	font-size: 15px;
	color: var(--ec-lm-ink);
	padding: 0 9px;
	margin: 0;
}

.ec-lm-cell-heading {
	font-weight: 700;
	color: #1a1a1a;
	line-height: 1.25;
}

.ec-lm-cell-empty {
	min-height: 30px;
}

.ec-lm-cell-note {
	min-height: 30px;
	justify-content: flex-end;
	font-size: 13px;
	font-style: italic;
	color: var(--ec-lm-ink);
	text-align: right;
}

.ec-lm-cell-input {
	padding: 0;
	position: relative;
}

.ec-lm-form input[type="text"],
.ec-lm-form input[type="email"] {
	width: 100%;
	height: 40px;
	box-sizing: border-box;
	border: 0;
	border-radius: 0;
	background: transparent;
	padding: 0 9px;
	margin: 0;
	font-family: inherit;
	font-size: 16px;
	color: var(--ec-lm-ink);
	line-height: 40px;
	box-shadow: none;
}

.ec-lm-form input::placeholder {
	color: #a8adaa;
}

.ec-lm-form input:focus {
	outline: none;
}

.ec-lm-cell-input.is-active {
	box-shadow: inset 0 0 0 2px var(--ec-lm-accent);
}

.ec-lm-cell-input.is-active::after {
	content: "";
	position: absolute;
	right: -1px;
	bottom: -1px;
	width: 6px;
	height: 6px;
	background: var(--ec-lm-accent);
	border: 1px solid #fff;
}

.ec-lm-cell-input.has-error {
	box-shadow: inset 0 0 0 2px #c0392b;
}

/* Button cell */

.ec-lm-cell-button {
	padding: 0;
	background: var(--ec-lm-btn);
}

.ec-lm-button {
	width: 100%;
	height: 100%;
	min-height: 40px;
	background: var(--ec-lm-btn);
	color: var(--ec-lm-btn-ink);
	border: 0;
	border-radius: 0;
	padding: 0 14px;
	font-family: inherit;
	font-size: 16px;
	font-weight: 700;
	line-height: 1.2;
	cursor: pointer;
	white-space: nowrap;
}

.ec-lm-button:hover {
	filter: brightness(0.93);
}

.ec-lm-button:focus-visible {
	outline: 2px solid var(--ec-lm-accent);
	outline-offset: -4px;
}

.ec-lm-button[disabled] {
	opacity: 0.65;
	cursor: default;
}

/* Around the sheet */

.ec-lm-sub {
	font-size: 14px;
	line-height: 1.5;
	color: #5a5f5c;
	margin: 8px 0 0;
}

.ec-lm-message {
	font-size: 14px;
	margin: 8px 0 0;
	display: none;
}

.ec-lm-message.is-visible {
	display: block;
}

.ec-lm-message.is-error {
	color: #b3261e;
}

.ec-lm-message.is-ok {
	color: #1f7a45;
}

.ec-lm-hp {
	position: absolute;
	left: -9999px;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

@media (max-width: 782px) {
	.ec-lm-grid {
		grid-template-columns: 24px minmax(0, 1fr);
	}

	.ec-lm-corner,
	.ec-lm-colhead,
	.ec-lm-cell-empty {
		display: none;
	}

	.ec-lm-rowhead {
		grid-row: span 3;
		align-items: flex-start;
		padding-top: 12px;
	}

	.ec-lm-rowhead[data-row="2"] {
		grid-row: span 1;
	}

	.ec-lm-cell-note {
		justify-content: flex-start;
		text-align: left;
	}
}

/* ---------------------------------------------------------------
   Style variants
   --------------------------------------------------------------- */

/* Dark — Excel's dark theme */

.ec-lm-style-dark {
	--ec-lm-ink: #e8eae9;
	--ec-lm-line: #3c403e;
	--ec-lm-chrome: #2b2f2d;
	--ec-lm-chrome-active: #3b403d;
	--ec-lm-chrome-ink: #9aa09d;
}

.ec-lm-style-dark .ec-lm-sheet {
	border-color: #3c403e;
	background: #212523;
}

.ec-lm-style-dark .ec-lm-cell,
.ec-lm-style-dark .ec-lm-fbar {
	background: #212523;
}

.ec-lm-style-dark .ec-lm-cell-heading {
	color: #ffffff;
}

.ec-lm-style-dark .ec-lm-cell-note {
	color: #b9bfbc;
}

.ec-lm-style-dark .ec-lm-form input[type="text"],
.ec-lm-style-dark .ec-lm-form input[type="email"] {
	color: #e8eae9;
}

.ec-lm-style-dark .ec-lm-form input::placeholder {
	color: #7d8481;
}

.ec-lm-style-dark .ec-lm-colhead.is-active,
.ec-lm-style-dark .ec-lm-rowhead.is-active {
	color: #ffffff;
}

.ec-lm-style-dark .ec-lm-corner::after {
	border-color: transparent transparent #6d736f transparent;
}

.ec-lm-style-dark .ec-lm-cell-input.is-active::after {
	border-color: #212523;
}

/* Bare — cells only, no headers or outer frame */

.ec-lm-style-bare .ec-lm-sheet {
	border: 0;
}

.ec-lm-style-bare .ec-lm-corner,
.ec-lm-style-bare .ec-lm-colhead,
.ec-lm-style-bare .ec-lm-rowhead,
.ec-lm-style-bare .ec-lm-cell-empty {
	display: none;
}

.ec-lm-style-bare .ec-lm-grid {
	grid-template-columns: minmax(0, 2.1fr) minmax(0, 0.9fr) minmax(0, 1.2fr) minmax(0, 1.1fr);
	background: transparent;
	gap: 0;
}

.ec-lm-style-bare .ec-lm-cell {
	border: 1px solid var(--ec-lm-line);
	border-right-width: 0;
	min-height: 48px;
}

.ec-lm-style-bare .ec-lm-cell-button {
	border: 0;
}

.ec-lm-style-bare .ec-lm-cell-note {
	grid-column: 1 / -1;
	border: 0;
	justify-content: flex-end;
	padding-top: 6px;
	min-height: 0;
}

.ec-lm-style-bare .ec-lm-button {
	min-height: 48px;
}

.ec-lm-style-bare .ec-lm-form input[type="text"],
.ec-lm-style-bare .ec-lm-form input[type="email"] {
	height: 46px;
	line-height: 46px;
}

/* Window — the whole thing framed like the app */

.ec-lm-style-window .ec-lm-sheet {
	border-color: #c6cbc8;
	border-radius: 4px;
	box-shadow: 0 2px 10px rgba(0, 0, 0, 0.12);
}

.ec-lm-titlebar {
	display: flex;
	align-items: center;
	gap: 9px;
	height: 32px;
	padding: 0 11px;
	background: var(--ec-lm-accent);
}

.ec-lm-titlebar-dot {
	width: 11px;
	height: 11px;
	border-radius: 2px;
	background: rgba(255, 255, 255, 0.85);
}

.ec-lm-titlebar-text {
	font-size: 13px;
	color: #ffffff;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.ec-lm-tabbar {
	display: flex;
	align-items: center;
	gap: 2px;
	background: var(--ec-lm-chrome);
	border-top: 1px solid var(--ec-lm-line);
	padding: 4px 8px;
}

.ec-lm-tab {
	font-size: 12px;
	color: var(--ec-lm-ink);
	background: #fff;
	padding: 4px 14px;
	border-radius: 3px 3px 0 0;
	box-shadow: inset 0 2px 0 var(--ec-lm-accent);
}

.ec-lm-tab-add {
	font-size: 14px;
	color: var(--ec-lm-chrome-ink);
	padding: 0 8px;
}

/* Small print sitting outside the box */

.ec-lm-note {
	font-size: 12px;
	font-style: italic;
	color: #5f6461;
	text-align: right;
	margin: 9px 3px 0;
}

/* Bar — outlined banner with underlined blanks */

.ec-lm-style-bar {
	--ec-lm-outline: #111111;
	--ec-lm-bar-bg: #edefec;
}

.ec-lm-style-bar .ec-lm-sheet {
	background: var(--ec-lm-bar-bg);
	border: 2px solid var(--ec-lm-outline);
	border-radius: 5px;
	box-shadow: 5px 5px 0 rgba(17, 17, 17, 0.85);
	padding: 14px 18px;
	overflow: visible;
}

.ec-lm-style-bar .ec-lm-corner,
.ec-lm-style-bar .ec-lm-colhead,
.ec-lm-style-bar .ec-lm-rowhead,
.ec-lm-style-bar .ec-lm-cell-empty,
.ec-lm-style-bar .ec-lm-fbar {
	display: none;
}

.ec-lm-style-bar .ec-lm-grid {
	display: grid;
	grid-template-columns: minmax(0, auto) minmax(70px, 0.5fr) minmax(120px, 1fr) auto;
	align-items: center;
	gap: 4px 20px;
	background: transparent;
}

.ec-lm-style-bar .ec-lm-cell {
	background: transparent;
	min-height: 42px;
	padding: 0;
}

.ec-lm-style-bar .ec-lm-cell-heading {
	min-width: 0;
	font-size: 23px;
	line-height: 1.2;
	font-weight: 700;
	color: var(--ec-lm-outline);
	letter-spacing: -0.01em;
}

.ec-lm-style-bar .ec-lm-cell-input {
	border-bottom: 2px solid #2b2b2b;
	box-shadow: none;
}

.ec-lm-style-bar .ec-lm-cell-input.is-active {
	border-bottom-color: var(--ec-lm-btn);
	box-shadow: none;
}

.ec-lm-style-bar .ec-lm-cell-input.is-active::after {
	display: none;
}

.ec-lm-style-bar .ec-lm-cell-input.has-error {
	border-bottom-color: #c0392b;
	box-shadow: none;
}

.ec-lm-style-bar .ec-lm-form input[type="text"],
.ec-lm-style-bar .ec-lm-form input[type="email"] {
	height: 38px;
	line-height: 38px;
	padding: 0 2px;
	font-size: 17px;
	color: var(--ec-lm-outline);
}

.ec-lm-style-bar .ec-lm-form input::placeholder {
	font-style: italic;
	font-weight: 700;
	color: #8b908b;
	opacity: 1;
}

.ec-lm-style-bar .ec-lm-cell-button {
	background: transparent;
	white-space: nowrap;
}

.ec-lm-style-bar .ec-lm-button {
	height: auto;
	min-height: 0;
	padding: 10px 26px;
	border: 2px solid var(--ec-lm-outline);
	border-radius: 5px;
	box-shadow: 3px 3px 0 var(--ec-lm-outline);
	font-size: 17px;
}

.ec-lm-style-bar .ec-lm-button:hover {
	filter: none;
	transform: translate(1px, 1px);
	box-shadow: 2px 2px 0 var(--ec-lm-outline);
}

.ec-lm-style-bar .ec-lm-button:active {
	transform: translate(3px, 3px);
	box-shadow: 0 0 0 var(--ec-lm-outline);
}

.ec-lm-style-bar .ec-lm-cell-note {
	grid-column: 1 / -1;
	justify-content: flex-end;
	min-height: 0;
	padding-top: 2px;
	font-size: 12px;
}

@media (max-width: 782px) {
	.ec-lm-style-bar .ec-lm-grid {
		display: block;
	}

	.ec-lm-style-bar .ec-lm-cell {
		display: flex;
	}

	.ec-lm-style-bar .ec-lm-cell-heading {
		margin-bottom: 10px;
	}

	.ec-lm-style-bar .ec-lm-cell-input {
		margin-bottom: 12px;
	}

	.ec-lm-style-bar .ec-lm-button {
		width: 100%;
	}

	.ec-lm-note {
		text-align: left;
	}
}
