*, *::before, *::after {
	box-sizing: border-box;
}

body {
	margin: 0;
	padding: 2rem 1rem;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
	font-size: 16px;
	line-height: 1.6;
	color: #24292f;
	background: #ffffff;
}

main {
	max-width: 720px;
	margin: 0 auto;
}

h1 {
	font-size: 2em;
	font-weight: 600;
	margin: 0 0 0.25rem;
	color: #1f2328;
}

h2 {
	font-size: 1.25em;
	font-weight: 600;
	margin: 0 0 1rem;
	color: #1f2328;
}

/* Header */
.wishes-header {
	margin-bottom: 2.5rem;
	padding-bottom: 1.5rem;
	border-bottom: 1px solid #d1d9e0;
}

.wishes-tagline {
	color: #57606a;
	margin: 0;
}

/* Sections */
.wishes-section {
	margin-bottom: 2.5rem;
}

/* Form */
.wishes-form {
	display: flex;
	flex-direction: column;
	gap: 0.875rem;
}

.wishes-form-row {
	display: flex;
	flex-direction: column;
	gap: 0.375rem;
}

.wishes-form-row label {
	font-size: 0.875rem;
	font-weight: 500;
	color: #57606a;
}

.wishes-form input[type="text"],
.wishes-form textarea {
	width: 100%;
	padding: 0.5rem 0.75rem;
	font-size: 1rem;
	font-family: inherit;
	border: 1px solid #d1d9e0;
	border-radius: 6px;
	background: #ffffff;
	color: #24292f;
	transition: border-color 0.15s;
}

.wishes-form input[type="text"]:focus,
.wishes-form textarea:focus {
	outline: none;
	border-color: #0969da;
}

.wishes-form textarea {
	resize: vertical;
	min-height: 80px;
}

.wishes-submit-btn {
	align-self: flex-start;
	padding: 0.5rem 1.25rem;
	font-size: 0.9375rem;
	font-weight: 500;
	cursor: pointer;
	border: 1px solid rgba(27, 31, 36, 0.15);
	border-radius: 6px;
	background: #2da44e;
	color: #ffffff;
	transition: background 0.15s;
}

.wishes-submit-btn:hover {
	background: #2c974b;
}

/* Card created result */
.wishes-card-created {
	margin-top: 1rem;
	padding: 1rem;
	background: #f6f8fa;
	border-radius: 6px;
	border: 1px solid #d1d9e0;
}

.wishes-success {
	font-weight: 600;
	color: #1a7f37;
	margin: 0 0 0.5rem;
}

.wishes-share-row {
	display: flex;
	gap: 0.5rem;
	align-items: center;
}

.wishes-share-link {
	flex: 1;
	padding: 0.4rem 0.625rem;
	font-size: 0.875rem;
	font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
	border: 1px solid #d1d9e0;
	border-radius: 6px;
	background: #ffffff;
	color: #24292f;
	cursor: text;
}

.wishes-copy-btn {
	padding: 0.4rem 0.875rem;
	font-size: 0.875rem;
	font-weight: 500;
	cursor: pointer;
	border: 1px solid #d1d9e0;
	border-radius: 6px;
	background: #f6f8fa;
	color: #24292f;
	white-space: nowrap;
	transition: background 0.15s;
}

.wishes-copy-btn:hover {
	background: #eaeef2;
}

/* Card list */
.wishes-card-item {
	padding: 1rem;
	margin-bottom: 0.75rem;
	border: 1px solid #d1d9e0;
	border-radius: 6px;
}

.wishes-card-item-header {
	display: flex;
	justify-content: space-between;
	align-items: baseline;
	gap: 0.5rem;
}

.wishes-card-item-header h3 {
	margin: 0;
	font-size: 1rem;
	font-weight: 600;
	color: #1f2328;
}

.wishes-card-date,
.wishes-message-date {
	font-size: 0.8125rem;
	color: #57606a;
	white-space: nowrap;
}

.wishes-card-desc {
	margin: 0.375rem 0 0.625rem;
	color: #57606a;
	font-size: 0.9375rem;
}

.wishes-card-link {
	font-size: 0.875rem;
	color: #0969da;
	text-decoration: none;
}

.wishes-card-link:hover {
	text-decoration: underline;
}

/* Messages */
.wishes-message {
	padding: 0.875rem 0;
	border-bottom: 1px solid #d1d9e0;
}

.wishes-message:last-child {
	border-bottom: none;
}

.wishes-message-header {
	display: flex;
	justify-content: space-between;
	align-items: baseline;
	gap: 0.5rem;
	margin-bottom: 0.25rem;
}

.wishes-message-author {
	font-weight: 600;
	color: #1f2328;
}

.wishes-message-body {
	margin: 0;
	white-space: pre-wrap;
}

/* States */
.wishes-empty {
	color: #57606a;
	font-style: italic;
}

.wishes-loading {
	color: #57606a;
}

.wishes-error {
	color: #cf222e;
}

/* Dark mode */
@media (prefers-color-scheme: dark) {
	body {
		color: #e6edf3;
		background: #0d1117;
	}

	h1, h2 {
		color: #e6edf3;
	}

	.wishes-header {
		border-bottom-color: #30363d;
	}

	.wishes-tagline,
	.wishes-card-date,
	.wishes-message-date,
	.wishes-card-desc,
	.wishes-form-row label {
		color: #8b949e;
	}

	.wishes-form input[type="text"],
	.wishes-form textarea {
		background: #161b22;
		border-color: #30363d;
		color: #e6edf3;
	}

	.wishes-form input[type="text"]:focus,
	.wishes-form textarea:focus {
		border-color: #58a6ff;
	}

	.wishes-card-created,
	.wishes-card-item {
		background: #161b22;
		border-color: #30363d;
	}

	.wishes-share-link,
	.wishes-copy-btn {
		background: #0d1117;
		border-color: #30363d;
		color: #e6edf3;
	}

	.wishes-copy-btn:hover {
		background: #161b22;
	}

	.wishes-card-item-header h3,
	.wishes-message-author {
		color: #e6edf3;
	}

	.wishes-card-link {
		color: #58a6ff;
	}

	.wishes-message {
		border-bottom-color: #30363d;
	}

	.wishes-empty,
	.wishes-loading {
		color: #8b949e;
	}

	.wishes-success {
		color: #3fb950;
	}
}
