:root {
	--page-bg: #f4f1e8;
	--work-bg: #ffffff;
	--accent: #0f4d25;
	--accent-dark: #073517;
	--gold: #c9a53d;
	--border: #d8cfb8;
	--text: #1d211c;
	--muted: #5f665d;
	--header-h: 72px;
	--footer-h: 86px;
}

* {
	box-sizing: border-box;
}

html,
body {
	height: 100%;
	margin: 0;
}

body {
	background: var(--page-bg);
	color: var(--text);
	font-family: Arial, Helvetica, sans-serif;
	font-size: 16px;
}

.app-shell {
	display: grid;
	grid-template-rows: var(--header-h) minmax(0, 1fr) var(--footer-h);
	height: 100%;
	min-height: 100%;
}

.page-header {
	align-items: center;
	background: #fff;
	border-bottom: 1px solid var(--border);
	display: grid;
	grid-template-columns: 72px minmax(0, 1fr) 72px;
	position: relative;
}

.env-badge {
	align-items: center;
	background: var(--accent);
	color: #fff;
	display: flex;
	font-size: 11px;
	font-weight: 700;
	height: 100%;
	justify-content: center;
	left: 0;
	line-height: 1;
	position: absolute;
	text-orientation: upright;
	top: 0;
	writing-mode: vertical-rl;
	width: 14px;
}

.icon-button {
	align-items: center;
	background: #fff;
	border: 1px solid var(--border);
	border-radius: 6px;
	color: var(--accent);
	cursor: pointer;
	display: inline-flex;
	height: 48px;
	justify-content: center;
	margin-left: 20px;
	padding: 0;
	width: 48px;
}

.menu-button {
	background: var(--accent);
	border-color: var(--accent);
	color: #fff;
	margin-left: 0;
	margin-right: 20px;
	justify-self: end;
}

.icon-button svg {
	height: 28px;
	width: 28px;
}

.logo-link {
	align-items: center;
	display: inline-flex;
	justify-self: center;
}

.logo {
	display: block;
	height: 56px;
	object-fit: contain;
	width: auto;
}

.menu-wrap {
	position: relative;
}

.menu {
	background: transparent;
	border: 0;
	box-shadow: none;
	display: none;
	list-style: none;
	margin: 0;
	min-width: 220px;
	padding: 0;
	position: absolute;
	top: 48px;
	z-index: 10;
}

.menu::before {
	background: #fff;
	border: 1px solid var(--border);
	bottom: 0;
	box-shadow: 0 10px 24px rgba(31, 42, 25, .18);
	content: "";
	left: 0;
	position: absolute;
	right: 0;
	top: 6px;
	z-index: -1;
}

.menu-hover-spacer {
	background: transparent;
	border: 0;
	height: 6px;
	margin: 0;
	padding: 0;
}

.menu-wrap.menu-open .menu {
	display: block;
}

@media (hover: hover) and (pointer: fine) {
	.menu-wrap:focus-within .menu,
	.menu-wrap:hover .menu {
		display: block;
	}
}

.account-menu {
	left: 20px;
}

.nav-menu {
	right: 20px;
}

.menu a,
.menu span {
	color: var(--text);
	display: block;
	padding: 9px 14px;
	text-decoration: none;
	white-space: nowrap;
}

.menu a:hover,
.menu a:focus {
	background: #edf5e9;
	outline: none;
}

.menu .separator {
	border-top: 1px solid var(--border);
	margin: 6px 0;
}

.page-content {
	background: var(--page-bg);
	min-height: 0;
	overflow: hidden;
	padding: 32px;
}

.work-area {
	background: var(--work-bg);
	border: 1px solid var(--border);
	box-shadow: 0 18px 36px rgba(31, 42, 25, .12);
	margin: 0 auto;
	max-height: 100%;
	min-width: 40%;
	overflow-y: auto;
	padding: 32px 40px;
	width: max-content;
	max-width: 100%;
}

.page-title {
	align-items: center;
	display: flex;
	gap: 20px;
	margin-bottom: 28px;
}

.page-mark {
	align-items: center;
	border-radius: 50%;
	display: inline-flex;
	flex: 0 0 auto;
	height: 72px;
	justify-content: center;
	overflow: hidden;
	width: 72px;
}

.page-mark img {
	display: block;
	height: 100%;
	object-fit: contain;
	width: 100%;
}

h1 {
	color: var(--accent);
	font-size: 32px;
	line-height: 1.1;
	margin: 0 0 8px;
}

h2,
h3,
h4,
h5,
h6 {
	color: var(--accent);
}

p {
	color: var(--muted);
	line-height: 1.45;
	margin: 0;
	max-width: 58ch;
}

.template-list {
	border-collapse: collapse;
	margin-top: 24px;
	min-width: 520px;
	width: 100%;
}

.template-list th {
	background: var(--accent);
	color: #fff;
	font-weight: 700;
	padding: 9px 12px;
	text-align: left;
}

table th {
	background: var(--accent);
	color: #fff;
	font-weight: 700;
}

.template-list td {
	border-bottom: 1px solid var(--border);
	padding: 11px 12px;
}

.primary-button,
.secondary-button {
	background: var(--accent);
	border: 0;
	border-radius: 6px;
	color: #fff;
	cursor: pointer;
	font-size: 16px;
	font-weight: 700;
	margin-top: 24px;
	padding: 12px 18px;
}

.primary-button {
	background: var(--accent);
	color: #fff;
	font-weight: 700;
}

.primary-button:hover,
.primary-button:focus {
	background: var(--accent-dark);
	outline: 2px solid var(--gold);
	outline-offset: 2px;
}

.page-footer {
	align-content: center;
	background: var(--page-bg);
	color: var(--muted);
	display: grid;
	font-size: 14px;
	justify-items: center;
	line-height: 1.35;
	text-align: center;
}

.page-footer a {
	color: var(--accent);
}

.terms-work-area {
	width: min(920px, 100%);
}

.terms-content h1,
.terms-content h2 {
	color: var(--accent);
}

.terms-content h1 {
	font-size: 32px;
	margin: 0 0 18px;
}

.terms-content h2 {
	font-size: 20px;
	margin: 28px 0 10px;
}

.terms-content p,
.terms-content li {
	color: var(--text);
	line-height: 1.5;
	max-width: 86ch;
}

.terms-content p {
	margin: 0 0 12px;
}

.terms-content ul {
	margin: 0 0 14px 24px;
	padding: 0;
}


.user-menu-label {
	background: var(--accent);
	color: #fff !important;
	font-weight: 700;
}

.data-form {
	display: grid;
	gap: 0;
	margin-top: 20px;
}

.data-form label {
	align-items: center;
	display: grid;
	grid-template-columns: 150px max-content;
	margin: 8px 0 0;
}

.data-form label span {
	font-weight: 700;
	text-align: right;
}

.data-form input {
	font: inherit;
	margin-left: 24px;
	padding: 4px;
	width: 20ch;
}

.form-actions {
	display: flex;
	gap: 10px;
	justify-content: flex-end;
	margin-top: 22px;
}

.secondary-button {
	background: #fff;
	border: 1px solid var(--border);
	color: var(--accent);
	text-decoration: none;
}

.passkey-button {
	background: var(--accent);
	border: 0;
	border-radius: 6px;
	color: #fff;
	cursor: pointer;
	font-size: 16px;
	font-weight: 700;
	justify-self: center;
	margin-top: 22px;
	order: 2;
	padding: 12px 18px;
}

.admin-actions {
	display: flex;
	margin-top: 20px;
}

.admin-icon-link {
	align-items: center;
	border: 1px solid var(--border);
	color: var(--accent);
	display: inline-flex;
	gap: 12px;
	padding: 10px 12px;
	text-decoration: none;
}

.admin-icon-link:hover,
.admin-icon-link:focus {
	outline: 2px solid var(--gold);
	outline-offset: 2px;
}

.admin-icon-link img {
	height: 42px;
	width: 42px;
}

.admin-icon-link span {
	font-weight: 700;
}

.config-form input[name="AppName"] {
	width: 28ch;
}

.config-form input[name="ShortAppName"] {
	width: 18ch;
}

.config-form input[type="color"] {
	height: 34px;
	padding: 2px;
	width: 8ch;
}

.color-control {
	align-items: center;
	display: inline-flex;
	margin-left: 24px;
}

.config-form .color-control input[type="color"] {
	margin-left: 0;
	margin-top: 0;
}

.color-code {
	font-family: Consolas, "Courier New", monospace;
	font-weight: 700;
	margin-left: 10px;
	text-align: left;
}

.color-code-input {
	font-family: Consolas, "Courier New", monospace;
	margin-left: 10px;
	width: 9ch;
}

.login-form .login-fields {
	order: 1;
}

.login-form .form-actions {
	order: 3;
}

.login-form .account-prompt {
	order: 4;
}

.account-prompt {
	margin-top: 18px;
	text-align: right;
}

.account-prompt a {
	color: var(--accent);
	font-weight: 700;
}

.create-account-form input {
	width: 20ch;
}

.login-fields {
	display: grid;
	justify-content: center;
	margin-top: 20px;
	width: 100%;
}

.login-fields label {
	grid-template-columns: 120px max-content;
}

.login-form .login-fields {
	margin-left: auto;
	margin-right: auto;
	width: max-content;
}

.login-form .password-control input {
	margin-left: 0;
}

.password-reset-fields {
	display: grid;
	grid-template-columns: max-content;
}

.password-reset-fields input {
	margin-left: 0;
	width: 20ch;
}

.password-control {
	display: inline-flex;
	margin-left: 24px;
}

.unmask-button {
	background: #fff;
	border: 1px solid var(--border);
	border-left: 0;
	cursor: pointer;
	padding: 4px 8px;
}

.password-match {
	grid-column: 2;
	margin: 8px 0 0 24px;
}

.match-ok {
	color: #0f6b2f;
}

.match-bad {
	color: #a82020;
}

.primary-button:disabled {
	background: #8b9488;
	cursor: not-allowed;
}

.recovery-fields input {
	width: 25ch;
}

.login-form .form-actions {
	justify-content: flex-end;
}

.login-form .account-prompt {
	margin-top: 36px;
	text-align: center;
}

.form-message {
	margin: 0 0 16px;
	padding: 10px 12px;
}

.form-error {
	background: #fff1f1;
	border: 1px solid #c85656;
	color: #7f1d1d;
}

.form-message ul {
	margin: 0 0 0 18px;
	padding: 0;
}

@media (max-width: 640px) {
	.app-shell {
		grid-template-rows: var(--header-h) minmax(0, 1fr);
	}

	.page-footer {
		display: none;
	}

	.page-content {
		padding: 0;
	}

	.work-area {
		border: 0;
		box-shadow: none;
		height: 100%;
		min-width: 100%;
		padding: 24px 16px;
		width: 100%;
	}

	.logo {
		height: 48px;
		max-width: 180px;
	}

	.icon-button {
		height: 44px;
		margin-left: 18px;
		width: 44px;
	}

	.menu-button {
		margin-right: 12px;
	}

	.page-title {
		align-items: flex-start;
		gap: 14px;
	}

	.page-mark {
		height: 54px;
		width: 54px;
	}

	h1 {
		font-size: 26px;
	}

	.template-list {
		min-width: 0;
	}

	.passkey-button {
		margin-top: 20px;
		order: 0;
	}

	.data-form label {
		align-items: start;
		grid-template-columns: 1fr;
	}

	.data-form label span {
		text-align: left;
	}

	.data-form input {
		margin-left: 0;
		margin-top: 6px;
		width: 100%;
	}
}


@media (min-width: 641px) and (max-width: 1180px) and (orientation: landscape) {
	.app-shell {
		grid-template-rows: var(--header-h) minmax(0, 1fr);
	}

	.page-footer {
		display: none;
	}
}


.password-reset-form {
	width: 100%;
}

.password-reset-form .login-fields {
	justify-content: center;
	width: 100%;
}

.password-reset-form .login-fields label {
	grid-template-columns: 140px max-content;
}

.password-reset-form .password-match {
	grid-column: 1;
	margin-left: 164px;
}

.password-reset-form .form-actions {
	justify-content: flex-end;
}

.terms-work-area,
.work-area {
	overflow-x: hidden;
}

.reset-account-label {
	background: var(--accent);
	color: #fff;
	font-weight: 700;
	grid-column: 1;
	margin: 0 0 12px 0;
	padding: 8px 10px;
	width: max-content;
}

.passkey-manager {
	min-width: min(620px, calc(100vw - 112px));
}

.passkey-manager h2 {
	color: var(--accent);
	font-size: 30px;
	margin: 22px 0 12px;
}

.passkey-actions {
	justify-content: flex-start;
	margin-top: 0;
}

.passkey-list {
	list-style: none;
	margin: 0;
	padding: 0;
}

.passkey-list li {
	align-items: center;
	border: 1px solid var(--border);
	display: flex;
	gap: 20px;
	justify-content: space-between;
	margin: 0 0 8px;
	padding: 10px 12px;
}

.passkey-list strong,
.passkey-list span {
	display: block;
}

.passkey-list span {
	color: var(--muted);
	font-size: 13px;
	margin-top: 3px;
}

.delete-button {
	align-items: center;
	background: #fff;
	border: 1px solid var(--border);
	border-radius: 6px;
	color: #a82020;
	cursor: pointer;
	display: inline-flex;
	height: 42px;
	justify-content: center;
	padding: 0;
	width: 42px;
}

.delete-button svg {
	fill: none;
	height: 22px;
	stroke: currentColor;
	stroke-linecap: round;
	stroke-linejoin: round;
	stroke-width: 2;
	width: 22px;
}

.dialog-open {
	overflow: hidden;
}

.app-dialog-backdrop {
	align-items: center;
	background: rgba(29, 33, 28, .42);
	bottom: 0;
	display: flex;
	justify-content: center;
	left: 0;
	padding: 18px;
	position: fixed;
	right: 0;
	top: 0;
	z-index: 1000;
}

.app-dialog {
	background: #fff;
	border: 1px solid var(--border);
	box-shadow: 0 18px 36px rgba(31, 42, 25, .22);
	max-width: min(420px, 100%);
	padding: 22px 24px;
	width: 100%;
}

.app-dialog h2 {
	color: var(--accent);
	font-size: 22px;
	margin: 0 0 10px;
}

.app-dialog p {
	color: var(--text);
	margin: 0;
}

.app-dialog-actions {
	display: flex;
	gap: 10px;
	justify-content: flex-end;
	margin-top: 22px;
}

.app-dialog .primary-button,
.app-dialog .secondary-button {
	margin-top: 0;
}

@media (max-width: 640px) {
	.passkey-manager {
		min-width: 0;
	}

	.passkey-list li {
		align-items: stretch;
		flex-direction: column;
		gap: 10px;
	}
}
