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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #f0f4f8;
  color: #2d3748;
  min-height: 100vh;
}

.container {
  max-width: 640px;
  margin: 0 auto;
  padding: 16px;
}

h1 {
  font-size: 1.3rem;
  font-weight: 700;
  text-align: center;
  padding: 16px 0 12px;
  color: #2d3748;
}

/* フォーム */
.form-section {
  background: #fff;
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 12px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}

.form-section h2 {
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 12px;
  color: #4a5568;
}

.form-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.form-row label {
  font-size: 0.9rem;
  white-space: nowrap;
  color: #4a5568;
}

select,
input[type="text"],
input[type="date"] {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #cbd5e0;
  border-radius: 8px;
  font-size: 0.95rem;
  color: #2d3748;
  background: #f7fafc;
  outline: none;
  transition: border-color 0.2s;
}

select:focus,
input:focus {
  border-color: #4299e1;
  background: #fff;
}

#add-btn {
  width: 100%;
  padding: 12px;
  background: #4299e1;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}

#add-btn:hover {
  background: #3182ce;
}

/* フィルター */
.filter-section {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.filter-btn {
  padding: 6px 12px;
  border: 1px solid #cbd5e0;
  border-radius: 20px;
  background: #fff;
  font-size: 0.85rem;
  cursor: pointer;
  color: #4a5568;
  transition: all 0.2s;
}

.filter-btn.active {
  background: #4299e1;
  color: #fff;
  border-color: #4299e1;
}

.filter-btn:hover:not(.active) {
  background: #edf2f7;
}

/* リスト */
.list-section {
  background: #fff;
  border-radius: 12px;
  padding: 4px 0;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
  min-height: 100px;
}

#item-list {
  list-style: none;
}

.item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 16px;
  border-bottom: 1px solid #edf2f7;
  transition: background 0.15s;
}

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

.item:hover {
  background: #f7fafc;
}

.item.done {
  opacity: 0.5;
}

.item.done .item-name {
  text-decoration: line-through;
  color: #a0aec0;
}

.check-btn {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid #cbd5e0;
  background: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 2px;
  transition: all 0.2s;
  font-size: 13px;
  color: transparent;
}

.item.done .check-btn {
  background: #48bb78;
  border-color: #48bb78;
  color: #fff;
}

.item-body {
  flex: 1;
  min-width: 0;
}

.item-header {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 2px;
}

.type-badge {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 10px;
  white-space: nowrap;
  flex-shrink: 0;
}

.badge-提出物 {
  background: #fed7d7;
  color: #c53030;
}

.badge-宿題 {
  background: #bee3f8;
  color: #2b6cb0;
}

.badge-持ち物 {
  background: #c6f6d5;
  color: #276749;
}

.item-name {
  font-size: 0.95rem;
  font-weight: 500;
  word-break: break-word;
}

.item-date {
  font-size: 0.82rem;
  color: #718096;
  margin-top: 2px;
}

.item-date.overdue {
  color: #e53e3e;
  font-weight: 600;
}

.item-date.today {
  color: #d69e2e;
  font-weight: 600;
}

.delete-btn {
  flex-shrink: 0;
  background: none;
  border: none;
  color: #a0aec0;
  font-size: 1.1rem;
  cursor: pointer;
  padding: 2px 4px;
  border-radius: 4px;
  transition: color 0.2s;
  line-height: 1;
}

.delete-btn:hover {
  color: #e53e3e;
}

.empty-msg {
  text-align: center;
  color: #a0aec0;
  font-size: 0.9rem;
  padding: 24px;
}

@media (max-width: 400px) {
  h1 {
    font-size: 1.1rem;
  }
  .filter-section {
    gap: 4px;
  }
  .filter-btn {
    font-size: 0.8rem;
    padding: 5px 10px;
  }
}
