/* ===== リセット・ベース ===== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: sans-serif;
  background: #f5f5f5;
  color: #333;
  min-height: 100vh;
}

/* ===== アプリ全体 ===== */
.app {
  max-width: 480px;
  margin: 0 auto;
  padding: 0 0 80px;
}

/* ===== ヘッダー ===== */
.header {
  background: #4a90d9;
  color: #fff;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 10;
}

.header h1 {
  font-size: 1.2rem;
  font-weight: bold;
}

.counter {
  font-size: 0.85rem;
  opacity: 0.9;
}

/* ===== 入力エリア ===== */
.input-area {
  display: flex;
  gap: 8px;
  padding: 16px;
  background: #fff;
  border-bottom: 1px solid #e0e0e0;
}

.input-area input {
  flex: 1;
  height: 44px;
  padding: 0 12px;
  font-size: 1rem;
  border: 1px solid #ccc;
  border-radius: 8px;
  outline: none;
  background: #f9f9f9;
}

.input-area input:focus {
  border-color: #4a90d9;
  background: #fff;
}

/* ===== ツールバー ===== */
.toolbar {
  padding: 10px 16px;
  background: #fff;
  border-bottom: 1px solid #e0e0e0;
}

/* ===== ボタン共通 ===== */
.btn {
  height: 44px;
  padding: 0 18px;
  font-size: 0.9rem;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-weight: bold;
  transition: opacity 0.15s;
}

.btn:active {
  opacity: 0.7;
}

.btn-add {
  background: #4a90d9;
  color: #fff;
  white-space: nowrap;
}

.btn-clear {
  background: #f0f0f0;
  color: #666;
  font-size: 0.85rem;
  height: 36px;
}

/* ===== リスト ===== */
.item-list {
  list-style: none;
  padding: 8px 16px;
}

.item {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #fff;
  border-radius: 10px;
  padding: 14px 14px;
  margin-bottom: 8px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
  cursor: pointer;
  transition: background 0.15s;
}

.item:active {
  background: #f0f0f0;
}

/* チェックアイコン */
.check-icon {
  width: 26px;
  height: 26px;
  border: 2px solid #ccc;
  border-radius: 50%;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  color: #fff;
  transition: background 0.15s, border-color 0.15s;
}

.item.checked .check-icon {
  background: #4a90d9;
  border-color: #4a90d9;
}

/* 品物テキスト */
.item-text {
  flex: 1;
  font-size: 1rem;
  line-height: 1.4;
  word-break: break-all;
}

.item.checked .item-text {
  text-decoration: line-through;
  color: #aaa;
}

/* 削除ボタン */
.delete-btn {
  width: 32px;
  height: 32px;
  border: none;
  background: none;
  color: #ccc;
  font-size: 1.2rem;
  cursor: pointer;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: color 0.15s, background 0.15s;
}

.delete-btn:hover,
.delete-btn:active {
  color: #e55;
  background: #fff0f0;
}

/* ===== 空メッセージ ===== */
.empty-msg {
  text-align: center;
  color: #bbb;
  font-size: 0.95rem;
  padding: 48px 16px;
  display: none;
}

/* ===== スマホ調整 ===== */
@media (max-width: 480px) {
  .header h1 {
    font-size: 1.1rem;
  }

  .input-area {
    padding: 12px;
  }

  .item-list {
    padding: 8px 12px;
  }
}
