@import url('https://fonts.googleapis.com/css2?family=DM+Serif+Display&family=Space+Grotesk:wght@400;500;600&display=swap');

:root {
	--ink: #1a1a1a;
	--muted: #59636e;
	--bg: #f6f5f1;
	--card: #ffffff;
	--accent: #0f766e;
	--accent-2: #f7b733;
	--grid: #e1e2e6;
	--shadow: 0 10px 30px rgba(20, 20, 20, 0.08);
}

* {
	box-sizing: border-box;
}

body {
	margin: 0;
	font-family: "Space Grotesk", "Segoe UI", sans-serif;
	color: var(--ink);
	background: radial-gradient(circle at 10% 10%, #fff5e6 0%, transparent 45%),
		radial-gradient(circle at 90% 20%, #e6f6f4 0%, transparent 40%),
		var(--bg);
	min-height: 100vh;
}

body.login-page {
	--accent: #f7b733;
	--accent-2: #f7b733;
	background: radial-gradient(circle at 20% 20%, rgba(255, 200, 120, 0.2) 0%, transparent 35%),
		radial-gradient(circle at 80% 10%, rgba(255, 255, 255, 0.08) 0%, transparent 45%),
		#0f0f0f;
}

body.login-page .topbar {
	display: none;
}

.app {
	max-width: 1200px;
	margin: 0 auto;
	padding: 24px 18px 110px;
}

.topbar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	margin-bottom: 20px;
}

.topbar-actions {
	display: inline-flex;
	align-items: center;
	gap: 12px;
	flex-wrap: wrap;
	max-width: 100%;
}

.topbar-links {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	white-space: nowrap;
}

.nav-link {
	text-decoration: none;
	color: var(--ink);
	font-weight: 600;
	font-size: 13px;
	padding: 6px 10px;
	border-radius: 999px;
	border: 1px solid #efeef0;
	background: #fff;
	box-shadow: var(--shadow);
	position: relative;
}

.nav-badge {
	position: absolute;
	top: -6px;
	right: -6px;
	background: #ef4444;
	color: #fff;
	font-size: 10px;
	min-width: 16px;
	height: 16px;
	padding: 0 4px;
	border-radius: 999px;
	display: none;
	align-items: center;
	justify-content: center;
}

.nav-badge.visible {
	display: inline-flex;
}

@media (max-width: 720px) {
	.topbar {
		align-items: flex-start;
	}

	.topbar-actions {
		width: 100%;
		justify-content: flex-start;
		gap: 10px;
	}

	.topbar-links {
		width: 100%;
		flex-wrap: wrap;
	}

	.nav-link {
		flex: 1 1 auto;
		text-align: center;
	}

	.last-login-strip {
		width: 100%;
		justify-content: center;
		flex-wrap: wrap;
	}
}

.nav-link:hover {
	border-color: #dfe2e7;
}

.brand-title {
	font-family: "DM Serif Display", "Times New Roman", serif;
	font-size: 30px;
	letter-spacing: 0.5px;
}

.brand-subtitle {
	color: var(--muted);
	font-size: 14px;
}

.user-pill {
	background: var(--card);
	border-radius: 999px;
	padding: 8px 14px;
	font-size: 14px;
	display: inline-flex;
	gap: 10px;
	align-items: center;
	box-shadow: var(--shadow);
	border: 1px solid #efeef0;
	white-space: normal;
	flex-wrap: wrap;
	max-width: 100%;
}

.user-pill .link-button {
	white-space: nowrap;
}

.last-login-strip {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	padding: 6px 10px;
	border-radius: 999px;
	background: #fff;
	border: 1px solid #efeef0;
	box-shadow: var(--shadow);
	font-size: 12px;
	color: var(--muted);
}

.last-login-item {
	display: inline-flex;
	align-items: center;
	gap: 6px;
}

.last-login-dot {
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: var(--last-login-color, #9ca3af);
}

.notif-bell {
	position: relative;
	width: 44px;
	height: 44px;
	padding: 0;
	border-radius: 999px;
	border: 1px solid #efeef0;
	background: #fff;
	color: var(--ink);
	font-size: 13px;
	font-weight: 600;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	box-shadow: var(--shadow);
	cursor: pointer;
	line-height: 1;
	white-space: nowrap;
}

.notif-icon svg {
	width: 18px;
	height: 18px;
	fill: currentColor;
}

.sr-only {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	border: 0;
}

.notif-badge {
	position: absolute;
	top: -4px;
	right: -4px;
	background: #ef4444;
	color: #fff;
	font-size: 11px;
	min-width: 18px;
	height: 18px;
	padding: 0 4px;
	border-radius: 999px;
	display: none;
	align-items: center;
	justify-content: center;
}

.notif-badge.visible {
	display: inline-flex;
}

.user-pill::before {
	content: "";
	width: 10px;
	height: 10px;
	border-radius: 50%;
	background: var(--user-color, var(--accent));
}

.link-button {
	background: none;
	border: none;
	color: var(--accent);
	font-weight: 600;
	cursor: pointer;
}

.panic-btn {
	background: #8bd5e9;
	color: #fff;
	border: 1px solid #7f1d1d;
	padding: 8px 14px;
	border-radius: 999px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.4px;
	box-shadow: var(--shadow);
	position: fixed;
	right: 22px;
	bottom: 22px;
	z-index: 1000;
}

.panic-btn:hover {
	filter: brightness(1.05);
}

@media (max-width: 720px) {
	.panic-btn {
		right: 16px;
		bottom: 16px;
		padding: 10px 16px;
	}
}

.login-panel {
	display: grid;
	place-items: center;
	min-height: 100vh;
	padding: 32px 16px;
}

.login-card {
	width: min(460px, 100%);
	background: var(--card);
	border-radius: 20px;
	padding: 34px 32px 30px;
	box-shadow: 0 20px 50px rgba(0, 0, 0, 0.25);
	border: 1px solid rgba(247, 183, 51, 0.2);
	text-align: center;
}

.login-logo {
	display: block;
	max-width: 200px;
	width: 100%;
	height: auto;
	margin: 0 auto 18px;
}

.login-logo-text {
	text-align: center;
	font-family: "DM Serif Display", "Times New Roman", serif;
	font-size: 22px;
	letter-spacing: 0.6px;
	color: #f7b733;
	margin: -6px 0 12px;
}

body.login-page .login-form button {
	background: #f7b733;
	color: #111;
	box-shadow: 0 10px 20px rgba(247, 183, 51, 0.35);
}

.login-form {
	display: grid;
	gap: 14px;
	text-align: left;
}

.forgot-link {
	text-align: center;
	font-size: 13px;
	color: var(--muted);
	text-decoration: underline;
	cursor: default;
}

.login-success {
	position: fixed;
	inset: 0;
	background: rgba(10, 10, 10, 0.78);
	display: grid;
	place-items: center;
	opacity: 0;
	pointer-events: none;
	transition: opacity 0.35s ease;
	z-index: 9999;
}

.login-success.visible {
	opacity: 1;
	pointer-events: all;
}

.login-success-card {
	width: min(520px, 90vw);
	background: #121212;
	border: 1px solid rgba(247, 183, 51, 0.4);
	border-radius: 18px;
	padding: 28px 26px 24px;
	text-align: center;
	color: #f8f5ee;
	box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5);
	animation: loginSuccessPop 0.5s ease;
}

.login-success-title {
	font-family: "DM Serif Display", "Times New Roman", serif;
	font-size: 22px;
	letter-spacing: 0.4px;
	margin-bottom: 8px;
	font-weight: 700;
}

.login-success-text {
	font-size: 14px;
	color: rgba(248, 245, 238, 0.78);
	line-height: 1.4;
	text-align: center;
}

.login-success-text p {
	margin: 8px 0;
}

.login-success-opt {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	margin-top: 12px;
	font-size: 13px;
	color: rgba(248, 245, 238, 0.8);
}

.login-success-opt input {
	width: 16px;
	height: 16px;
}

.login-success-ok {
	margin-top: 16px;
	background: #f7b733;
	color: #111;
	padding: 10px 22px;
	border-radius: 999px;
	font-weight: 700;
	border: none;
	cursor: pointer;
}

.welcome-editor {
	position: fixed;
	inset: 0;
	background: rgba(10, 10, 10, 0.75);
	display: grid;
	place-items: center;
	z-index: 10001;
}

.welcome-editor-card {
	width: min(640px, 92vw);
	background: #121212;
	border: 1px solid rgba(247, 183, 51, 0.35);
	border-radius: 16px;
	padding: 20px;
	color: #f8f5ee;
	box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5);
}

.welcome-editor-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 10px;
}

.welcome-editor-header h3 {
	margin: 0;
	font-family: "DM Serif Display", "Times New Roman", serif;
	font-size: 20px;
}

.welcome-editor-close {
	background: transparent;
	border: 1px solid rgba(248, 245, 238, 0.3);
	color: #f8f5ee;
	width: 36px;
	height: 36px;
	border-radius: 999px;
	cursor: pointer;
}

.welcome-editor-text {
	width: 100%;
	min-height: 180px;
	border-radius: 12px;
	border: 1px solid rgba(248, 245, 238, 0.2);
	background: #1a1a1a;
	color: #f8f5ee;
	padding: 10px 12px;
	font-size: 14px;
	line-height: 1.4;
}

.welcome-editor-error {
	min-height: 18px;
	color: #fca5a5;
	font-size: 13px;
	margin-top: 6px;
}

.welcome-editor-actions {
	display: flex;
	justify-content: flex-end;
	gap: 10px;
	margin-top: 12px;
}

@media (max-width: 600px) {
	.login-success-card {
		width: min(92vw, 420px);
		padding: 22px 18px 20px;
	}

	.login-success-title {
		font-size: 20px;
	}

	.login-success-text {
		font-size: 13px;
	}

	.login-success-ok {
		width: 100%;
	}
}

@keyframes loginSuccessPop {
	from {
		transform: translateY(12px) scale(0.98);
		opacity: 0;
	}

	to {
		transform: translateY(0) scale(1);
		opacity: 1;
	}
}


label {
	display: grid;
	gap: 6px;
	font-size: 14px;
	color: var(--muted);
}

.inline-toggle {
	display: flex;
	align-items: center;
	gap: 10px;
	color: var(--ink);
	font-weight: 500;
}

.inline-toggle input {
	width: 16px;
	height: 16px;
}

.email-wrap {
	display: none;
}

.email-wrap.visible {
	display: grid;
}

input,
textarea {
	padding: 10px 12px;
	border-radius: 10px;
	border: 1px solid #dcdde2;
	font-family: inherit;
	font-size: 15px;
}

button {
	background: var(--accent);
	color: #fff;
	border: none;
	padding: 10px 16px;
	border-radius: 10px;
	font-weight: 600;
	cursor: pointer;
}

button.ghost {
	background: transparent;
	color: var(--accent);
	border: 1px solid var(--accent);
}

.form-error {
	color: #b00020;
	font-size: 13px;
	min-height: 18px;
}

.calendar-panel {
	background: #ececef;
	border-radius: 18px;
	padding: 14px;
	box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
	border: 1px solid #d9dce2;
}

.help-strip {
	margin: 8px 0 10px;
	background: #ffffff;
	border: 1px solid #ececf0;
	border-radius: 12px;
	padding: 8px 11px;
	font-size: 13px;
	color: #334155;
	box-shadow: var(--shadow);
	line-height: 1.35;
}

.help-strip strong {
	color: var(--ink);
	margin-right: 6px;
}

.dashboard-grid {
	display: flex;
	flex-direction: column;
	gap: 18px;
}

.board-panel {
	margin-top: 20px;
	background: var(--card);
	border-radius: 20px;
	padding: 18px;
	box-shadow: var(--shadow);
	border: 1px solid #f0f0f0;
	display: grid;
	gap: 16px;
}

.board-header h2 {
	margin: 0 0 6px;
	font-family: "DM Serif Display", serif;
	font-size: 24px;
}

.board-header-top {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
}

.board-header-top h2 {
	margin: 0;
}

.board-view-actions {
	display: flex;
	align-items: center;
	gap: 8px;
	flex-wrap: wrap;
}

.board-view-actions .ghost.is-active {
	background: #e7f5ff;
	border-color: #bfdbfe;
	color: #0f172a;
}

.board-header p {
	margin: 0;
	color: var(--muted);
	font-size: 14px;
}

.board-list {
	column-count: 4;
	column-gap: 12px;
}

.board-history {
	break-inside: avoid;
	margin: 0 0 12px;
	padding: 8px 10px;
	border: 1px solid #ececf0;
	border-radius: 12px;
	background: #f8fafc;
}

.board-history>summary {
	cursor: pointer;
	font-size: 13px;
	font-weight: 600;
	color: #334155;
	list-style: none;
}

.board-history>summary::-webkit-details-marker {
	display: none;
}

.board-history>summary::before {
	content: "▸";
	display: inline-block;
	margin-right: 6px;
	transition: transform 0.2s ease;
}

.board-history[open]>summary::before {
	transform: rotate(90deg);
}

.board-history .board-card {
	margin-top: 10px;
}

.board-empty {
	background: #f6f6f6;
	border-radius: 12px;
	padding: 12px;
	color: var(--muted);
	font-size: 13px;
}

.activity-feed-list {
	display: grid;
	gap: 10px;
}

.activity-feed-item {
	display: grid;
	gap: 8px;
	padding: 11px 12px;
	border-radius: 12px;
	border: 1px solid #e6e9ef;
	background: #fff;
	box-shadow: 0 5px 12px rgba(15, 23, 42, 0.06);
}

.activity-feed-tags {
	display: inline-flex;
	gap: 6px;
	flex-wrap: wrap;
}

.activity-tag {
	display: inline-flex;
	align-items: center;
	padding: 3px 8px;
	border-radius: 999px;
	font-size: 11px;
	font-weight: 600;
	line-height: 1.2;
	border: 1px solid transparent;
}

.activity-tag.is-created {
	background: #ecfdf5;
	color: #166534;
	border-color: #bbf7d0;
}

.activity-tag.is-updated {
	background: #eff6ff;
	color: #1e40af;
	border-color: #bfdbfe;
}

.activity-tag.is-deleted {
	background: #fff1f2;
	color: #9f1239;
	border-color: #fecdd3;
}

.activity-tag.is-event {
	background: #f8fafc;
	color: #475569;
	border-color: #e2e8f0;
}

.activity-tag.is-match {
	background: #fff7ed;
	color: #9a3412;
	border-color: #fed7aa;
}

.activity-feed-main {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	flex-wrap: wrap;
}

.activity-feed-text {
	display: flex;
	gap: 6px;
	align-items: baseline;
	flex-wrap: wrap;
	font-size: 14px;
	color: #0f172a;
}

.activity-feed-date {
	font-weight: 700;
	color: #1e293b;
}

.activity-feed-action {
	color: #334155;
}

.activity-feed-meta {
	display: inline-flex;
	align-items: center;
	gap: 7px;
	font-size: 12px;
	color: #64748b;
}

.activity-feed-user-dot {
	width: 9px;
	height: 9px;
	border-radius: 50%;
	background: var(--activity-user-color, #64748b);
	border: 1px solid rgba(0, 0, 0, 0.12);
}

.activity-open-link {
	justify-self: start;
	font-size: 12px;
	font-weight: 600;
	color: #1d4ed8;
	text-decoration: none;
	padding: 5px 8px;
	border-radius: 999px;
	border: 1px solid #bfdbfe;
	background: #eff6ff;
}

.activity-open-link:hover {
	background: #dbeafe;
}

.board-card {
	border: 1px solid #ececf0;
	border-radius: 14px;
	padding: 10px 12px;
	background: #fff;
	box-shadow: 0 6px 14px rgba(0, 0, 0, 0.05);
	display: inline-grid;
	width: 100%;
	margin: 0 0 12px;
	break-inside: avoid;
	gap: 6px;
	align-content: start;
}

.board-card::before {
	content: "";
	width: 48px;
	height: 4px;
	border-radius: 999px;
	background: var(--user-color, var(--accent));
}

.board-meta {
	display: flex;
	align-items: center;
	justify-content: space-between;
	font-size: 12px;
	color: var(--muted);
	flex-wrap: wrap;
	gap: 4px 10px;
}

.board-user {
	font-weight: 600;
	color: var(--ink);
}

.board-text {
	font-size: 13px;
	line-height: 1.35;
	word-break: break-word;
	overflow-wrap: anywhere;
}

.board-actions {
	display: flex;
	align-items: center;
	gap: 8px;
	flex-wrap: wrap;
}

.like-btn {
	background: #f1f5f9;
	border: 1px solid #e2e8f0;
	color: #0f172a;
	padding: 5px 10px;
	border-radius: 999px;
	font-size: 11px;
}

.like-btn.liked {
	background: #fee2e2;
	border-color: #fecaca;
	color: #991b1b;
}

.board-comments {
	display: grid;
	gap: 4px;
	background: #f8fafc;
	padding: 6px 8px;
	border-radius: 10px;
}

.board-comment-empty {
	font-size: 12px;
	color: var(--muted);
}

.board-comment {
	display: flex;
	gap: 6px;
	align-items: center;
	font-size: 11px;
}

.board-comment-user {
	font-weight: 600;
	color: var(--ink);
}

.board-comment-user::before {
	content: "";
	display: inline-block;
	width: 7px;
	height: 7px;
	border-radius: 50%;
	margin-right: 6px;
	background: var(--user-color, var(--accent));
}

.board-comment-text {
	color: var(--muted);
	word-break: break-word;
	overflow-wrap: anywhere;
}

.comment-delete {
	margin-left: auto;
}

.board-comment-form {
	display: flex;
	gap: 6px;
	flex-direction: column;
}

.board-comment-form input {
	width: 100%;
}

.board-comment-form button {
	width: 100%;
}

.board-image img {
	width: 100%;
	max-height: 360px;
	object-fit: contain;
	background: #f8fafc;
	border-radius: 12px;
	border: 1px solid #ececf0;
	cursor: zoom-in;
}

.board-form {
	display: grid;
	gap: 12px;
}

.audio-recorder {
	display: grid;
	gap: 10px;
	padding: 12px;
	border-radius: 12px;
	border: 1px solid #ececf0;
	background: #f8fafc;
}

.audio-recorder-status {
	font-size: 13px;
	color: var(--muted);
}

.audio-recorder-controls {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

.audio-recorder audio {
	width: 100%;
}

.audio-recorder-fallback {
	font-size: 12px;
	color: var(--muted);
	display: grid;
	gap: 8px;
}

.board-feed .board-list,
.audio-feed .audio-list {
	margin-top: 4px;
}

.board-delete,
.comment-delete,
.audio-delete {
	background: #fee2e2;
	border: 1px solid #fecaca;
	color: #7f1d1d;
	padding: 6px 10px;
	border-radius: 8px;
	font-size: 12px;
}

.board-actions .board-delete {
	margin-left: auto;
}

.audio-panel {
	margin-top: 20px;
	background: var(--card);
	border-radius: 20px;
	padding: 18px;
	box-shadow: var(--shadow);
	border: 1px solid #f0f0f0;
	display: grid;
	gap: 16px;
}

.audio-list {
	display: grid;
	gap: 12px;
	grid-template-columns: repeat(3, minmax(260px, 1fr));
	align-items: start;
}

.audio-card {
	border: 1px solid #ececf0;
	border-radius: 14px;
	padding: 10px 12px;
	background: #fff;
	box-shadow: 0 6px 14px rgba(0, 0, 0, 0.05);
	display: grid;
	gap: 8px;
}

.audio-card audio {
	width: 100%;
}

.audio-actions {
	display: flex;
	align-items: center;
	gap: 8px;
	flex-wrap: wrap;
}

.audio-reply-btn {
	background: #e7f5ff;
	border: 1px solid #cfe7ff;
	color: #0b4f71;
	padding: 5px 10px;
	border-radius: 999px;
	font-size: 11px;
}

.audio-reply-meta {
	font-size: 11px;
	color: var(--muted);
}

.audio-reply {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	background: #f8fafc;
	border: 1px solid #e2e8f0;
	padding: 6px 8px;
	border-radius: 10px;
	font-size: 11px;
}

.audio-delete {
	justify-self: flex-end;
}

.toast-container {
	position: fixed;
	right: 16px;
	bottom: 16px;
	display: grid;
	gap: 8px;
	z-index: 200;
}

.toast {
	background: #111827;
	color: #fff;
	padding: 10px 14px;
	border-radius: 10px;
	box-shadow: 0 10px 24px rgba(0, 0, 0, 0.2);
	animation: toast-in 0.25s ease;
}

.toast.hide {
	opacity: 0;
	transform: translateY(6px);
	transition: opacity 0.3s ease, transform 0.3s ease;
}

@keyframes toast-in {
	from {
		opacity: 0;
		transform: translateY(8px);
	}

	to {
		opacity: 1;
		transform: translateY(0);
	}
}

.calendar-toolbar {
	display: flex;
	align-items: center;
	gap: 8px;
	flex-wrap: nowrap;
	margin-bottom: 12px;
}

.nav-btn {
	width: 36px;
	height: 36px;
	display: grid;
	place-items: center;
	border-radius: 9px;
	background: #f8fafc;
	color: #0f172a;
	border: 1px solid #cfd5de;
	padding: 0;
	flex: 0 0 auto;
}

.month-title {
	font-family: "DM Serif Display", serif;
	font-size: clamp(24px, 3.1vw, 30px);
	flex: 1 1 auto;
	text-align: center;
	background: #e1e4e9;
	border: 1px solid #d3d8e0;
	border-radius: 10px;
	padding: 7px 10px;
	color: #111827;
	margin-bottom: 0;
	line-height: 1.15;
}

.today-btn {
	background: #dbeafe;
	color: #0f172a;
	border: 1px solid #bfdbfe;
	margin-left: 2px;
	padding: 8px 12px;
	border-radius: 10px;
	flex: 0 0 auto;
}

.legend {
	display: flex;
	gap: 12px;
	flex-wrap: wrap;
	margin-bottom: 14px;
}

.legend-item {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	font-size: 13px;
	background: #f8f8f8;
	padding: 6px 10px;
	border-radius: 999px;
}

.legend-item span {
	width: 10px;
	height: 10px;
	border-radius: 50%;
	background: var(--legend-color);
}

.legend-item-match span {
	background: #ef4444;
}

.match-preview {
	margin: 0 0 14px;
	padding: 11px 13px;
	border: 1px solid #d8dce3;
	border-radius: 12px;
	background: #f8fafc;
	display: grid;
	gap: 4px;
}

.match-preview.is-empty {
	background: #f8fafc;
	border-color: #d8dce3;
}

.match-preview.is-has-match {
	background: #fff1f2;
	border-color: #fecdd3;
}

.group-info {
	margin: 0 0 14px;
	padding: 11px 13px;
	border: 1px solid #d8dce3;
	border-radius: 12px;
	background: #f8fafc;
	display: grid;
	gap: 8px;
}

.group-info-header {
	font-weight: 700;
	font-size: 14px;
	color: #0f172a;
}

.group-name {
	font-weight: 600;
	font-size: 13px;
	color: #334155;
}

.group-members-list {
	display: flex;
	gap: 8px;
	flex-wrap: wrap;
}

.group-member-item {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	font-size: 12px;
	background: #ffffff;
	padding: 4px 8px;
	border-radius: 999px;
	border: 1px solid #e2e8f0;
}

.member-dot {
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: var(--member-color);
}

.match-preview-title {
	font-weight: 700;
	font-size: 14px;
	color: #0f172a;
}

.match-preview-note {
	font-size: 13px;
	color: #334155;
}

.calendar-grid {
	display: grid;
	gap: 8px;
	grid-template-columns: repeat(7, minmax(0, 1fr));
}

.weekday {
	font-size: 19px;
	font-weight: 700;
	color: #1f2937;
	text-align: center;
	padding: 10px 4px;
	border-radius: 7px;
	border: 1px solid #d3d8e0;
	background: #e4e7ec;
}

.days {
	display: grid;
	grid-template-columns: repeat(7, minmax(0, 1fr));
	gap: 8px;
	grid-column: 1 / -1;
}

.day {
	min-height: 92px;
	border: 1px solid #cfd5de;
	border-radius: 6px;
	padding: 8px 8px 7px;
	display: flex;
	flex-direction: column;
	gap: 5px;
	background: #f5f6f8;
	cursor: pointer;
	transition: border-color 0.16s ease, background-color 0.16s ease, box-shadow 0.16s ease;
}

.day.weekend {
	background: #edeff2;
}

.day.today {
	border-color: #1d4ed8;
	background: linear-gradient(180deg, #e8f1ff 0%, #f3f7ff 100%);
	box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.24), 0 7px 16px rgba(29, 78, 216, 0.18);
}

.day.day-match {
	border-color: #ef4444;
	box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.25);
}

.day:hover {
	background: #eef2f7;
	border-color: #94a3b8;
	box-shadow: 0 4px 12px rgba(15, 23, 42, 0.08);
}

.day.today .day-number {
	width: 34px;
	height: 34px;
	margin: 0 auto;
	border-radius: 999px;
	background: #1d4ed8;
	color: #fff;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	box-shadow: 0 3px 10px rgba(29, 78, 216, 0.35);
}

.day.outside {
	background: #f9fafb;
	border-color: #e5e7eb;
}

.day-number {
	font-weight: 700;
	font-size: 25px;
	background: transparent;
	border: 0;
	padding: 0;
	margin: 0;
	text-align: center;
	font-family: inherit;
	color: #111827;
	cursor: pointer;
	line-height: 1;
	min-height: 28px;
}

.day-events {
	display: grid;
	gap: 4px;
	font-size: 12px;
}

.match-day-visual {
	align-self: center;
	justify-self: center;
	width: 56px;
	height: 56px;
	padding: 0;
	border: 0;
	background: transparent;
	cursor: pointer;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	transition: transform 0.16s ease, filter 0.16s ease;
}

.match-day-visual:hover {
	transform: translateY(-1px) scale(1.04);
	filter: drop-shadow(0 6px 10px rgba(148, 163, 184, 0.35));
}

.match-day-visual img {
	max-width: 100%;
	max-height: 100%;
	object-fit: contain;
	pointer-events: none;
	user-select: none;
}

.day.outside .day-number {
	color: #9ca3af;
}

.day-summary {
	display: none;
	flex-direction: column;
	align-items: stretch;
	gap: 4px;
	font-size: 11px;
	color: var(--muted);
	background: #f7f7f8;
	border: 1px solid #ececf0;
	border-radius: 8px;
	padding: 4px 6px;
	min-height: 24px;
}


.day-summary-row {
	display: grid;
	grid-template-columns: 8px minmax(0, 1fr) auto;
	align-items: center;
	gap: 6px;
}

.day-summary-user {
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}


.day-summary-color {
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: var(--summary-color, #64748b);
	border: 1px solid rgba(0, 0, 0, 0.08);
}

.day-summary-count {
	font-weight: 600;
	color: #374151;
}

.event-pill {
	padding: 4px 6px;
	border-radius: 8px;
	color: #fff;
	font-weight: 600;
	line-height: 1.2;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.event-pill.is-match {
	background: #ef4444;
	color: #fff;
}

.event-pill small {
	display: block;
	font-weight: 400;
	opacity: 0.9;
}

.event-bubble {
	position: absolute;
	z-index: 5;
	left: 8px;
	right: 8px;
	top: 30px;
	background: #111827;
	color: #fff;
	padding: 8px 10px;
	border-radius: 10px;
	font-size: 12px;
	box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

.day {
	position: relative;
}

.modal {
	position: fixed;
	inset: 0;
	display: none;
	align-items: center;
	justify-content: center;
	z-index: 100;
}

.modal.open {
	display: flex;
}

.modal-backdrop {
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, 0.4);
}

.modal-card {
	position: relative;
	background: var(--card);
	border-radius: 18px;
	padding: 22px;
	width: min(480px, 92vw);
	max-height: calc(100vh - 24px);
	overflow: auto;
	z-index: 1;
	box-shadow: var(--shadow);
}

.modal-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	margin-bottom: 12px;
}

.modal-header h2 {
	margin: 0;
}

.modal-close {
	width: 36px;
	height: 36px;
	border-radius: 50%;
	border: 1px solid #e5e7eb;
	background: #fff;
	color: var(--muted);
	font-size: 22px;
	line-height: 1;
	padding: 0;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
}

.event-list {
	display: grid;
	gap: 10px;
	margin-bottom: 18px;
}

.event-list-empty {
	font-size: 13px;
	color: var(--muted);
	background: #f6f6f6;
	padding: 10px 12px;
	border-radius: 10px;
}

.event-list-row {
	display: grid;
	grid-template-columns: 10px 1fr auto;
	align-items: center;
	gap: 12px;
	background: #f8f8f8;
	padding: 10px 12px;
	border-radius: 12px;
}

.event-list-row.is-match {
	background: rgba(239, 68, 68, 0.14);
}

.event-list-row.is-match .event-list-color {
	background: #ef4444;
}

.event-list-color {
	width: 10px;
	height: 100%;
	border-radius: 999px;
	background: var(--event-color, #64748b);
}

.event-list-title {
	font-weight: 600;
	font-size: 13px;
}

.event-list-group {
	font-size: 11px;
	color: #999;
	margin-top: 1px;
}

.event-list-main {
	min-width: 0;
}

.event-list-note {
	font-size: 12px;
	color: var(--muted);
	margin-top: 2px;
}

.match-pick {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	font-size: 12px;
	color: #374151;
	white-space: nowrap;
}

.match-pick input {
	width: 16px;
	height: 16px;
}

.match-create {
	margin-top: 10px;
	padding: 12px;
	border: 1px dashed #fca5a5;
	border-radius: 12px;
	background: #fff1f2;
	display: grid;
	gap: 8px;
}

.match-create-title {
	font-weight: 700;
	color: #9f1239;
}

.match-create-hint {
	font-size: 12px;
	color: #6b7280;
}

.event-delete {
	background: #fee2e2;
	color: #7f1d1d;
	border: 1px solid #fecaca;
	padding: 6px 10px;
	border-radius: 8px;
	font-size: 12px;
}

.form-actions {
	display: flex;
	justify-content: flex-end;
	gap: 8px;
}

.match-popup {
	position: fixed;
	inset: 0;
	background: rgba(10, 10, 10, 0.55);
	display: grid;
	place-items: center;
	z-index: 11000;
}

.match-popup-card {
	width: min(420px, 92vw);
	background: #ffffff;
	border-radius: 16px;
	padding: 20px 18px;
	text-align: center;
	box-shadow: 0 20px 50px rgba(0, 0, 0, 0.25);
	border: 1px solid #f3e8ff;
	display: grid;
	gap: 10px;
}

.match-popup-heart {
	font-size: 36px;
	line-height: 1;
}

.match-popup-title {
	font-family: "DM Serif Display", serif;
	font-size: 24px;
	color: #7c3aed;
}

.match-popup-text {
	font-size: 14px;
	color: #334155;
}

.match-popup-ok {
	justify-self: center;
	min-width: 140px;
}

.match-popup-actions {
	display: flex;
	gap: 8px;
	justify-content: center;
	flex-wrap: wrap;
}

@media (max-width: 430px) {
	.topbar {
		flex-direction: column;
		align-items: flex-start;
	}

	.topbar-actions {
		width: 100%;
		justify-content: flex-start;
		gap: 10px;
	}

	.calendar-panel {
		padding: 14px;
	}

	.day {
		min-height: 96px;
	}

	.board-list {
		column-count: 2;
	}

	.audio-list {
		grid-template-columns: repeat(2, minmax(220px, 1fr));
	}
}

@media (max-width: 1200px) {
	.board-list {
		column-count: 3;
	}

	.audio-list {
		grid-template-columns: repeat(2, minmax(240px, 1fr));
	}
}

@media (max-width: 640px) {
	.app {
		padding: 16px 12px 50px;
	}

	.help-strip {
		font-size: 12px;
		padding: 7px 9px;
		margin: 6px 0 9px;
	}

	.month-title {
		font-size: 22px;
		padding: 7px 8px;
	}

	.legend {
		gap: 8px;
	}

	.day {
		min-height: 74px;
		padding: 6px;
		overflow: hidden;
	}

	.day-number {
		font-size: 19px;
	}

	.day-events {
		display: none;
	}

	.match-day-visual {
		width: 42px;
		height: 42px;
		margin: auto 0;
	}

	.day-summary {
		display: flex;
	}

	.event-pill {
		font-size: 11px;
	}

	.board-list {
		column-count: 1;
	}

	.audio-list {
		grid-template-columns: 1fr;
	}

	.board-card,
	.audio-card {
		padding: 9px 10px;
		border-radius: 12px;
	}

	.board-meta,
	.board-text,
	.board-comment,
	.audio-reply-meta {
		font-size: 11px;
	}

	.board-image img {
		max-height: 200px;
	}

	.board-comment-form {
		flex-direction: column;
	}

	.board-comment-form input,
	.board-comment-form button {
		width: 100%;
	}
}

@media (max-width: 520px) {
	body {
		font-size: 16px;
	}

	.topbar {
		gap: 8px;
	}

	.brand-title {
		font-size: 26px;
	}

	.brand-subtitle {
		font-size: 13px;
	}

	.calendar-toolbar {
		gap: 6px;
		flex-wrap: wrap;
	}

	.nav-btn {
		width: 36px;
		height: 36px;
	}

	.month-title {
		order: -1;
		flex: 1 0 100%;
	}

	.today-btn {
		padding: 8px 12px;
		margin-left: auto;
	}

	.weekday {
		font-size: 15px;
		padding: 8px 2px;
	}

	.day {
		min-height: 66px;
		padding: 5px;
	}

	.match-day-visual {
		width: 36px;
		height: 36px;
	}

	.day-number {
		font-size: 18px;
	}

	.event-pill {
		font-size: 12px;
		white-space: normal;
	}

	.modal-card {
		width: 100%;
		padding: 16px;
		border-radius: 14px;
	}

	.event-list-row {
		grid-template-columns: 10px 1fr;
		align-items: start;
	}

	.match-pick,
	.event-delete {
		grid-column: 2;
		justify-self: start;
	}
}

@media (max-width: 430px) {
	.calendar-panel {
		padding: 10px;
	}

	.month-title {
		font-size: 20px;
	}

	.legend-item {
		font-size: 12px;
		padding: 5px 8px;
	}

	.day {
		min-height: 60px;
		padding: 4px;
	}

	.day-events {
		font-size: 12px;
	}

	.dashboard-grid {
		display: flex;
		flex-direction: column;
	}
}