:root {
  --bg: #f5f6fa;
  --card-bg: #ffffff;
  --accent: #ff6b6b;
  --accent-light: #ffe3e3;
  --text: #2d3436;
  --muted: #8395a7;
  --border: #e1e4e8;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Yu Gothic", sans-serif;
  background: var(--bg);
  color: var(--text);
  padding-bottom: 40px;
}

header {
  background: var(--accent);
  color: #fff;
  padding: 20px 16px 24px;
  text-align: center;
  position: sticky;
  top: 0;
  z-index: 10;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

header h1 {
  margin: 0 0 12px;
  font-size: 1.3rem;
}

.progress-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: center;
  margin-bottom: 12px;
}

.progress-bar {
  width: 60%;
  max-width: 300px;
  height: 10px;
  background: rgba(255,255,255,0.4);
  border-radius: 5px;
  overflow: hidden;
}

#progress-fill {
  height: 100%;
  width: 0%;
  background: #fff;
  transition: width 0.3s ease;
}

#progress-text {
  font-size: 0.85rem;
  min-width: 56px;
}

#reset-btn {
  background: rgba(255,255,255,0.2);
  border: 1px solid rgba(255,255,255,0.6);
  color: #fff;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 0.8rem;
  cursor: pointer;
}

#reset-btn:active {
  background: rgba(255,255,255,0.35);
}

main {
  max-width: 600px;
  margin: 0 auto;
  padding: 16px;
}

.category {
  background: var(--card-bg);
  border-radius: 12px;
  margin-bottom: 16px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
  overflow: hidden;
}

.category-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 16px;
  cursor: pointer;
  user-select: none;
  border-bottom: 1px solid var(--border);
}

.category-header h2 {
  margin: 0;
  font-size: 1rem;
}

.category-count {
  font-size: 0.8rem;
  color: var(--muted);
}

.category-items {
  padding: 4px 16px 8px;
}

.category.collapsed .category-items {
  display: none;
}

.category.collapsed .category-header {
  border-bottom: none;
}

.category-header .arrow {
  transition: transform 0.2s ease;
  color: var(--muted);
  margin-left: 8px;
}

.category.collapsed .arrow {
  transform: rotate(-90deg);
}

.item {
  display: flex;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid #f0f0f0;
  font-size: 0.95rem;
}

.item:last-child {
  border-bottom: none;
}

.item input[type="checkbox"] {
  width: 22px;
  height: 22px;
  margin-right: 12px;
  flex-shrink: 0;
  accent-color: var(--accent);
}

.item label {
  flex: 1;
  cursor: pointer;
}

.item.checked label {
  text-decoration: line-through;
  color: var(--muted);
}

.note {
  font-size: 0.8rem;
  color: var(--muted);
  margin-top: 2px;
}
