:root {
	color-scheme: light;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
	line-height: 1.5;
}

* {
	box-sizing: border-box;
}

body {
	margin: 0;
	background: #f6f8fb;
	color: #1b1f24;
}

.container {
	max-width: 760px;
	margin: 0 auto;
	padding: 24px 16px 48px;
}

h1 {
	margin-bottom: 8px;
}

.intro {
	margin-top: 0;
	color: #4a5563;
}

.card {
	background: #ffffff;
	border: 1px solid #d9e0e8;
	border-radius: 12px;
	padding: 16px;
	margin-top: 16px;
}

label {
	display: block;
	margin-bottom: 12px;
	font-weight: 600;
}

input {
	display: block;
	width: 100%;
	margin-top: 6px;
	border: 1px solid #c5d0dc;
	border-radius: 8px;
	padding: 10px;
	font: inherit;
	font-weight: 400;
}

input:read-only {
	background: #f3f6fb;
}

select {
	display: block;
	width: 100%;
	margin-top: 6px;
	border: 1px solid #c5d0dc;
	border-radius: 8px;
	padding: 10px;
	font: inherit;
	font-weight: 400;
	background: #fff;
}

.grid-2 {
	display: grid;
	gap: 12px;
	grid-template-columns: 1fr 1fr;
}

button {
	border: 0;
	border-radius: 8px;
	background: #0f62fe;
	color: #fff;
	padding: 10px 14px;
	font: inherit;
	font-weight: 700;
	cursor: pointer;
}

button:hover {
	background: #0353e9;
}

.secondary {
	background: #eef3ff;
	color: #113fa3;
}

.secondary:hover {
	background: #dde7ff;
}

.danger {
	background: #fee4e2;
	color: #b42318;
}

.danger:hover {
	background: #fecdca;
}

.result ul {
	margin: 0;
	padding-left: 18px;
}

.result h3 {
	margin: 14px 0 8px;
}

.result ol {
	margin: 0;
	padding-left: 22px;
}

.actions {
	display: flex;
	gap: 8px;
	margin-top: 14px;
}

.history-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
}

.history-head h2 {
	margin: 0;
}

.history-list {
	list-style: none;
	padding: 0;
	margin: 12px 0 0;
	display: grid;
	gap: 10px;
}

.history-item {
	border: 1px solid #d9e0e8;
	border-radius: 10px;
	padding: 10px;
	background: #fbfcff;
}

.history-item p {
	margin: 0 0 8px;
	color: #4a5563;
}

.history-item button {
	padding: 6px 10px;
}

.history-actions {
	display: flex;
	gap: 8px;
}

.modal {
	position: fixed;
	inset: 0;
	z-index: 999;
	display: grid;
	place-items: center;
	padding: 16px;
}

.modal[hidden] {
	display: none;
}

.modal-backdrop {
	position: absolute;
	inset: 0;
	background: rgba(15, 23, 42, 0.45);
}

.modal-card {
	position: relative;
	z-index: 1;
	width: min(460px, 100%);
	background: #fff;
	border-radius: 12px;
	border: 1px solid #d9e0e8;
	padding: 16px;
	box-shadow: 0 12px 30px rgba(15, 23, 42, 0.2);
}

.modal-card h3 {
	margin: 0 0 8px;
}

.modal-card p {
	margin: 0;
	color: #4a5563;
}

.modal-actions {
	display: flex;
	justify-content: flex-end;
	gap: 8px;
	margin-top: 14px;
}

.error {
	color: #b42318;
	font-weight: 700;
}

@media (max-width: 640px) {
	.grid-2 {
		grid-template-columns: 1fr;
	}

	.actions,
	.history-head,
	.modal-actions {
		flex-direction: column;
		align-items: stretch;
	}
}
