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

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

.container {
  max-width: 480px;
  margin: 0 auto;
  padding: 20px 16px 40px;
}

h1 {
  font-size: 1.5rem;
  text-align: center;
  margin-bottom: 20px;
  color: #2e7d32;
}

/* 入力エリア */
.input-area {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}

.input-area input {
  flex: 1;
  padding: 10px 12px;
  font-size: 1rem;
  border: 2px solid #ccc;
  border-radius: 8px;
  outline: none;
  transition: border-color 0.2s;
}

.input-area input:focus {
  border-color: #4CAF50;
}

.input-area button {
  padding: 10px 16px;
  background: #4CAF50;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.2s;
}

.input-area button:hover {
  background: #388E3C;
}

/* リストヘッダー */
.list-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  font-size: 0.85rem;
  color: #666;
}

#clearCheckedBtn {
  background: none;
  border: 1px solid #bbb;
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 0.8rem;
  cursor: pointer;
  color: #666;
  transition: background 0.2s, color 0.2s;
}

#clearCheckedBtn:hover {
  background: #ffebee;
  color: #c62828;
  border-color: #c62828;
}

/* リスト */
#itemList {
  list-style: none;
}

#itemList li {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #fff;
  border-radius: 8px;
  padding: 12px 12px;
  margin-bottom: 8px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
  transition: opacity 0.2s;
}

#itemList li.checked {
  opacity: 0.5;
}

#itemList li input[type="checkbox"] {
  width: 20px;
  height: 20px;
  cursor: pointer;
  accent-color: #4CAF50;
  flex-shrink: 0;
}

.item-text {
  flex: 1;
  font-size: 1rem;
  word-break: break-all;
}

#itemList li.checked .item-text {
  text-decoration: line-through;
  color: #999;
}

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

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

/* 空メッセージ */
.empty-msg {
  text-align: center;
  color: #aaa;
  font-size: 0.9rem;
  margin-top: 24px;
  display: none;
}

.empty-msg.show {
  display: block;
}
