body { font-family: system-ui, sans-serif; max-width: 100%; margin: 2rem; padding: 0 2rem; }
label { display:block; margin-top:0.5rem }
input, textarea, select { width:100%; padding:0.5rem; margin-top:0.25rem }
#result { margin-top:1rem }

.todo-item {
	border: 1px solid #eee;
	padding: 0.6rem 0.75rem;
	margin: 0.5rem 0;
	border-radius: 6px;
	background: #fff;
}
.todo-title { display:flex; justify-content:space-between; align-items:center; gap:0.5rem; }
.todo-meta { color: #666; font-size: 0.85rem; margin-top: 0.25rem; }
.todo-tags { display:flex; align-items:center; flex-wrap:wrap; gap:0.35rem; margin-top:0.45rem; }
.todo-tag { display:inline-block; padding:0.15rem 0.45rem; border-radius:999px; background:#eef3ff; color:#1d4ed8; font-size:0.75rem; }
.todo-desc { margin-top: 0.5rem; color: #222; background: #fafafa; padding: 0.5rem; border-left: 3px solid #e6e6e6; border-radius: 4px; white-space: pre-wrap; }
.todo-item.completed .todo-title strong { text-decoration: line-through; color: #666; }

.badge { font-size: 0.75rem; padding: 0.12rem 0.4rem; border-radius: 999px; background: #eee; color: #333; margin-left: 0.5rem; }
.badge.completed { background: #dff7e0; color: #0b6b18; }
.badge.not-completed { background: #ffecec; color: #7a0303; }

/* Header */
header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 1rem;
	margin-bottom: 2rem;
	padding-bottom: 1rem;
	border-bottom: 2px solid #eee;
}

header h1 {
	margin: 0;
	flex: 1;
}

/* Buttons */
.btn-primary, .btn-secondary {
	padding: 0.6rem 1.2rem;
	border: none;
	border-radius: 6px;
	font-size: 0.95rem;
	cursor: pointer;
	font-weight: 500;
	transition: background-color 0.2s ease;
	white-space: nowrap;
}

.btn-primary {
	background-color: #0969da;
	color: white;
}

.btn-primary:hover {
	background-color: #0860ca;
}

.btn-secondary {
	background-color: #f3f3f3;
	color: #333;
	border: 1px solid #ddd;
}

.btn-secondary:hover {
	background-color: #e8e8e8;
}

/* Modal */
dialog {
	border: none;
	border-radius: 8px;
	box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
	padding: 0;
	max-width: 500px;
	width: 90%;
}

dialog::backdrop {
	background-color: rgba(0, 0, 0, 0.5);
}

.modal-content {
	display: flex;
	flex-direction: column;
	max-height: 90vh;
	overflow-y: auto;
}

.modal-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding: 1.5rem;
	border-bottom: 1px solid #eee;
	gap: 1rem;
}

.modal-header h2 {
	margin: 0;
	font-size: 1.3rem;
}

.close-btn {
	background: none;
	border: none;
	font-size: 1.8rem;
	cursor: pointer;
	color: #666;
	padding: 0;
	line-height: 1;
	min-width: 32px;
	min-height: 32px;
	display: flex;
	align-items: center;
	justify-content: center;
}

.close-btn:hover {
	color: #000;
}

#todo-form, #edit-form, #tag-picker-form, #github-import-form {
	padding: 1.5rem;
	display: flex;
	flex-direction: column;
	gap: 1rem;
}

#todo-form label, #edit-form label, #tag-picker-form label, #github-import-form label {
	margin-top: 0;
}

.modal-actions {
	display: flex;
	gap: 0.75rem;
	margin-top: 1rem;
	justify-content: flex-end;
}

.modal-actions button {
	flex: 0 0 auto;
}

#todos-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 1rem;
	margin-bottom: 1rem;
}

.todos-controls {
	display: flex;
	align-items: center;
	gap: 0.5rem;
}

#todo-sort-label {
	display: inline;
	margin-top: 0;
	white-space: nowrap;
}

#todo-sort {
	padding: 0.5rem;
	border: 1px solid #ddd;
	border-radius: 4px;
}

@media (max-width: 420px) {
	.todo-title { flex-direction: column; align-items: flex-start; }
	
	header {
		flex-direction: column;
		align-items: stretch;
	}
	
	#add-todo-btn {
		width: 100%;
	}
}
