:root {
	--ink: #1a1a1a;
	--muted: #4d4c48;
	--paper: #f7f6f3;
	--surface: #ffffff;
	--line: #b8b6af;
	--action: #1f3a5f;
	--action-hover: #152a47;
	--alert-bg: #fdecea;
	--alert-line: #b3261e;
	--env: #8a4b00;
	--env-bg: #ffe8b8;
}

* {
	box-sizing: border-box;
}

body {
	margin: 0;
	background: var(--paper);
	color: var(--ink);
	font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	font-size: 1rem;
	line-height: 1.5;
}

body.env-test,
body.env-development {
	border-top: 6px solid var(--env);
}

.env-banner {
	background: var(--env-bg);
	color: var(--env);
	padding: 0.5rem 1rem;
	font-weight: 600;
	text-align: center;
}

.site-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 0.75rem 1rem;
	background: var(--surface);
	border-bottom: 1px solid var(--line);
}

.brand {
	font-size: 1.25rem;
	font-weight: 700;
}

main {
	max-width: 32rem;
	margin: 0 auto;
	padding: 1.5rem 1rem 3rem;
}

h1 {
	font-size: 1.5rem;
	margin: 0 0 1rem;
}

h2 {
	font-size: 1.125rem;
	margin: 1.5rem 0 0.5rem;
}

.form {
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
}

label {
	font-weight: 600;
}

input[type="text"],
input[type="password"] {
	min-height: 2.75rem;
	padding: 0.5rem 0.75rem;
	border: 1px solid var(--muted);
	border-radius: 4px;
	background: var(--surface);
	color: var(--ink);
	font: inherit;
}

.check {
	display: flex;
	align-items: center;
	gap: 0.75rem;
	min-height: 2.75rem;
	font-weight: 400;
}

.check input {
	width: 1.5rem;
	height: 1.5rem;
}

.hint {
	margin: 0;
	color: var(--muted);
}

.button {
	min-height: 2.75rem;
	padding: 0.5rem 1.25rem;
	border: 0;
	border-radius: 4px;
	background: var(--action);
	color: #ffffff;
	font: inherit;
	font-weight: 600;
	cursor: pointer;
}

.button:hover {
	background: var(--action-hover);
}

.link-button {
	min-height: 2.75rem;
	min-width: 2.75rem;
	padding: 0.5rem 0.75rem;
	border: 0;
	background: none;
	color: var(--action);
	font: inherit;
	text-decoration: underline;
	cursor: pointer;
}

a {
	color: var(--action);
}

:focus-visible {
	outline: 3px solid var(--action);
	outline-offset: 2px;
}

.alert {
	margin: 0 0 1rem;
	padding: 0.75rem 1rem;
	border-left: 4px solid var(--alert-line);
	background: var(--alert-bg);
}

.notice {
	margin: 0 0 1rem;
	padding: 0.75rem 1rem;
	border-left: 4px solid var(--action);
	background: var(--surface);
}

a.button {
	display: inline-flex;
	align-items: center;
	text-decoration: none;
}

.facts {
	display: grid;
	grid-template-columns: max-content 1fr;
	gap: 0.25rem 1rem;
	margin: 0 0 1.5rem;
}

.facts dt {
	color: var(--muted);
}

.facts dd {
	margin: 0;
	font-weight: 600;
}

.roles {
	margin: 0;
	padding-left: 1.25rem;
}

.nav-main {
	display: flex;
	flex-wrap: wrap;
	gap: 0.25rem 1rem;
	padding: 0 1rem;
	background: var(--surface);
	border-bottom: 1px solid var(--line);
}

.nav-main a {
	display: inline-flex;
	align-items: center;
	min-height: 2.75rem;
}

main {
	max-width: 56rem;
}

select {
	min-height: 2.75rem;
	padding: 0.5rem 0.75rem;
	border: 1px solid var(--muted);
	border-radius: 4px;
	background: var(--surface);
	color: var(--ink);
	font: inherit;
}

.card {
	margin: 1rem 0;
	padding: 0 1rem 1rem;
	border: 1px solid var(--line);
	border-radius: 4px;
	background: var(--surface);
}

.inline-form {
	display: flex;
	flex-wrap: wrap;
	align-items: end;
	gap: 0.5rem;
	margin: 0.5rem 0;
}

.inline-form label {
	flex-basis: 100%;
}

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

.plain-list li {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.5rem 1rem;
	padding: 0.5rem 0;
	border-bottom: 1px solid var(--line);
}

.item-name {
	font-weight: 600;
}

.actions {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
}

.button-secondary {
	border: 1px solid var(--action);
	background: var(--surface);
	color: var(--action);
}

.button-secondary:hover {
	background: var(--paper);
}

.button-danger {
	background: #8a1c14;
}

.button-danger:hover {
	background: #6e1610;
}

.table {
	width: 100%;
	border-collapse: collapse;
	background: var(--surface);
}

.table th,
.table td {
	padding: 0.5rem 0.75rem;
	border-bottom: 1px solid var(--line);
	text-align: left;
	vertical-align: top;
}

.link-block {
	padding: 0.75rem 1rem;
	border: 1px solid var(--line);
	border-radius: 4px;
	background: var(--surface);
	overflow-wrap: anywhere;
}

.form {
	max-width: 32rem;
}

.visually-hidden {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
}

.table-wrap {
	overflow-x: auto;
}

.table a,
main p a {
	display: inline-flex;
	align-items: center;
	min-height: 2.75rem;
}

.sub-nav {
	display: flex;
	flex-wrap: wrap;
	gap: 0.25rem 1rem;
	margin: 0 0 1rem 0;
}

.sub-nav a {
	display: inline-flex;
	align-items: center;
	min-height: 2.75rem;
}

.sub-nav a[aria-current="page"] {
	font-weight: 700;
	text-decoration: none;
	color: var(--ink);
}

.meta {
	margin: 0 0 0.5rem 0;
	color: var(--muted);
}

.table .number {
	text-align: right;
	font-variant-numeric: tabular-nums;
	white-space: nowrap;
}

.table .over {
	color: var(--alert-line);
	font-weight: 700;
}

.table .number .mark {
	display: block;
}

.table .amount {
	width: 9rem;
	text-align: right;
}

.table tfoot th,
.table tfoot td {
	font-weight: 700;
}

.row-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
}

.lock {
	margin: 0 0 1rem;
	padding: 0.75rem 1rem;
	border: 1px solid var(--line);
	background: var(--surface);
}

.lock h2 {
	margin-top: 0;
}

.row-status {
	min-width: 5rem;
	align-self: center;
}

.js .save-fallback {
	display: none;
}

.row-error {
	color: var(--alert-line);
}

[hidden] {
	display: none !important;
}
