* { box-sizing: border-box; margin: 0; padding: 0; }

:root {
	--sky-blue-light: #8ecae6;
	--blue-green: #219ebc;
	--deep-space-blue: #023047;
	--amber-flame: #ffb703;
	--princeton-orange: #fb8500;

	--bg: #f5f8fa;
	--card: #ffffff;
	--border: #dde6ed;
	--text: #023047;
	--muted: #5a7485;
	--accent: #219ebc;
	--accent-warm: #fb8500;
	--highlight: #ffb703;
	--danger: #dc2626;
	--section-bg: #edf4f8;
	--next-time-bg: rgba(255,183,3,0.06);
	--radius: 10px;
}

body {
	font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
	background: var(--bg);
	color: var(--text);
	font-size: 16px;
	line-height: 1.5;
	-webkit-font-smoothing: antialiased;
}

.container {
	max-width: 480px;
	margin: 0 auto;
	padding: 0 12px 80px;
}

/* Nav */
nav {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 12px 16px;
	background: var(--card);
	border-bottom: 1px solid var(--border);
	position: sticky;
	top: 0;
	z-index: 100;
	max-width: 480px;
	margin: 0 auto;
}
nav a {
	text-decoration: none;
	color: var(--muted);
	font-weight: 600;
	font-size: 15px;
	padding: 4px 0;
	transition: color 0.2s;
}
nav a.active { color: var(--text); border-bottom: 2px solid var(--highlight); }
nav .name-btn {
	margin-left: auto;
	background: none;
	border: 1px solid var(--border);
	border-radius: 12px;
	padding: 2px 10px;
	font-size: 13px;
	color: var(--muted);
	cursor: pointer;
}

/* Section headers */
.section-header {
	font-size: 14px;
	font-weight: 700;
	letter-spacing: 0.3px;
	color: var(--text);
	padding: 20px 0 8px;
}
.section-header.sticky {
	position: sticky;
	top: 49px;
	background: var(--bg);
	z-index: 10;
}
.section-header.next-time {
	color: var(--text);
	border-left: 3px solid var(--highlight);
	padding-left: 10px;
}
.section-header.backlog {
	color: var(--muted);
	font-weight: 600;
	font-size: 13px;
}

/* Next time section background */
.next-time-section {
	background: var(--next-time-bg);
	border-radius: var(--radius);
	padding: 0 12px;
	margin: 4px -12px 8px;
}

/* Task rows */
.task-row {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 12px 0;
	border-bottom: 1px solid var(--border);
}
.task-row .check {
	width: 32px;
	height: 32px;
	border-radius: 50%;
	border: 2px solid var(--accent);
	background: var(--section-bg);
	font-size: 16px;
	color: var(--accent);
	cursor: pointer;
	flex-shrink: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: background 0.15s, transform 0.15s, color 0.15s;
}
.task-row .check:hover { background: var(--accent); color: white; transform: scale(1.05); }
.task-row .check:active { background: var(--accent); color: white; transform: scale(0.9); }
.task-row .title {
	flex: 1;
	cursor: pointer;
	font-size: 15px;
}
.task-row .action {
	background: none;
	border: 1px solid var(--border);
	border-radius: 6px;
	width: 32px;
	height: 32px;
	font-size: 14px;
	cursor: pointer;
	color: var(--muted);
	transition: background 0.15s;
}
.task-row .action:active { background: var(--section-bg); }

/* Expanded task */
.expanded {
	padding: 12px 0 16px 42px;
	border-bottom: 1px solid var(--border);
}
.expanded label {
	display: block;
	font-size: 12px;
	font-weight: 600;
	color: var(--muted);
	margin-top: 8px;
	margin-bottom: 2px;
}
.expanded input, .expanded textarea, .expanded select {
	width: 100%;
	padding: 8px;
	border: 1px solid var(--border);
	border-radius: var(--radius);
	font-size: 15px;
	font-family: inherit;
}
.expanded textarea { resize: vertical; }
.expanded .meta {
	font-size: 13px;
	color: var(--muted);
	display: block;
	margin-top: 4px;
}
.edit-actions {
	display: flex;
	gap: 8px;
	margin-top: 12px;
}
.edit-actions button {
	padding: 6px 16px;
	border-radius: var(--radius);
	border: none;
	font-size: 14px;
	cursor: pointer;
}
.edit-actions button:first-child { background: var(--accent); color: white; }
.edit-actions .delete { background: none; color: var(--danger); border: 1px solid var(--danger); }

/* Comments */
.comments { margin-top: 16px; }
.comments strong { font-size: 13px; color: var(--muted); }
.comment {
	padding: 8px 0;
	border-bottom: 1px solid var(--border);
	position: relative;
}
.comment-author { font-weight: 600; font-size: 13px; }
.comment-date { font-size: 12px; color: var(--muted); margin-left: 6px; }
.comment-delete {
	position: absolute;
	right: 0;
	top: 8px;
	background: none;
	border: none;
	color: var(--muted);
	cursor: pointer;
	font-size: 16px;
}
.comment p { font-size: 14px; margin-top: 2px; }
.comment-add {
	display: flex;
	gap: 8px;
	margin-top: 8px;
}
.comment-add input { flex: 1; padding: 8px; border: 1px solid var(--border); border-radius: var(--radius); font-size: 14px; }
.comment-add button { padding: 8px 12px; background: var(--accent); color: white; border: none; border-radius: var(--radius); cursor: pointer; }

/* Floating action button */
.fab {
	position: fixed;
	bottom: 20px;
	right: 20px;
	width: 56px;
	height: 56px;
	border-radius: 50%;
	background: var(--accent);
	color: white;
	font-size: 28px;
	border: none;
	cursor: pointer;
	box-shadow: 0 2px 12px rgba(33,158,188,0.3);
	z-index: 50;
	transition: transform 0.2s;
}
.fab:active { transform: scale(0.92); }
.fab-open { transform: rotate(45deg); }

/* Add form */
.add-form {
	position: fixed;
	bottom: 0;
	left: 0;
	right: 0;
	background: var(--card);
	padding: 16px;
	border-top: 1px solid var(--border);
	box-shadow: 0 -2px 12px rgba(2,48,71,0.1);
	z-index: 60;
	max-width: 480px;
	margin: 0 auto;
	border-radius: var(--radius) var(--radius) 0 0;
}
.add-form input, .add-form select, .add-form textarea {
	width: 100%;
	padding: 10px;
	border: 1px solid var(--border);
	border-radius: var(--radius);
	font-size: 16px;
	font-family: inherit;
	margin-bottom: 8px;
	resize: vertical;
}
.add-actions {
	display: flex;
	gap: 8px;
}
.add-actions button {
	flex: 1;
	padding: 10px;
	border-radius: var(--radius);
	border: none;
	font-size: 15px;
	cursor: pointer;
}
.add-actions button:first-child { background: var(--accent); color: white; }
.add-actions .cancel { background: var(--section-bg); color: var(--text); }

/* Name prompt */
.name-overlay {
	position: fixed;
	inset: 0;
	background: rgba(0,0,0,0.5);
	display: flex;
	align-items: center;
	justify-content: center;
	z-index: 200;
}
.name-dialog {
	background: var(--card);
	padding: 24px;
	border-radius: 12px;
	width: 280px;
	text-align: center;
}
.name-dialog h2 { font-size: 18px; margin-bottom: 12px; }
.name-dialog input {
	width: 100%;
	padding: 10px;
	border: 1px solid var(--border);
	border-radius: var(--radius);
	font-size: 16px;
	text-align: center;
	margin-bottom: 12px;
}
.name-dialog button {
	padding: 8px 24px;
	background: var(--accent);
	color: white;
	border: none;
	border-radius: var(--radius);
	font-size: 15px;
	cursor: pointer;
}

/* Activity log */
.log-entry {
	padding: 10px 0;
	border-bottom: 1px solid var(--border);
}
.log-title { font-size: 15px; display: block; }
.log-meta { font-size: 13px; color: var(--muted); }

.empty {
	text-align: center;
	color: var(--muted);
	padding: 40px 0;
}

/* Drag handle (for Task 12) */
.drag-handle {
	cursor: grab;
	color: var(--muted);
	font-size: 16px;
	padding: 4px;
	user-select: none;
	-webkit-user-select: none;
}
.drag-handle:active { cursor: grabbing; }

/* Completion animation */
.completing {
	animation: complete-fade 0.4s ease forwards;
}
@keyframes complete-fade {
	0% { opacity: 1; transform: translateX(0); }
	100% { opacity: 0; transform: translateX(30px); }
}
