* {
  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: 600px;
  margin: 0 auto;
  padding: 16px;
}

h1 {
  font-size: 1.4rem;
  margin-bottom: 16px;
  color: #2c6e49;
  text-align: center;
}

/* タブ */
.tabs {
  display: flex;
  border-bottom: 2px solid #2c6e49;
  margin-bottom: 16px;
}

.tab-btn {
  flex: 1;
  padding: 10px;
  background: none;
  border: none;
  font-size: 0.95rem;
  cursor: pointer;
  color: #666;
  transition: background 0.2s;
}

.tab-btn.active {
  background: #2c6e49;
  color: #fff;
  font-weight: bold;
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

/* 追加フォーム */
.add-item-form,
.add-aisle-form {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.add-item-form input,
.add-aisle-form input {
  flex: 1;
  min-width: 120px;
  padding: 10px;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 0.95rem;
}

.add-item-form select {
  flex: 1;
  min-width: 120px;
  padding: 10px;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 0.95rem;
  background: #fff;
}

.btn-primary {
  padding: 10px 16px;
  background: #2c6e49;
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 0.95rem;
  cursor: pointer;
  white-space: nowrap;
}

.btn-primary:hover {
  background: #1e4d33;
}

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

.btn-small {
  padding: 5px 10px;
  background: #e74c3c;
  color: #fff;
  border: none;
  border-radius: 4px;
  font-size: 0.8rem;
  cursor: pointer;
}

.btn-small:hover {
  background: #c0392b;
}

/* 買い物リスト */
#shopping-list,
#aisle-list {
  list-style: none;
}

#shopping-list li,
#aisle-list li {
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  margin-bottom: 8px;
  padding: 12px;
}

.empty-message {
  text-align: center;
  color: #aaa;
  font-size: 0.9rem;
  padding: 24px !important;
  border: none !important;
  background: none !important;
}

/* 買い物アイテム */
.shopping-item {
  display: flex;
  align-items: center;
  gap: 10px;
}

.shopping-item input[type="checkbox"] {
  width: 20px;
  height: 20px;
  cursor: pointer;
  accent-color: #2c6e49;
  flex-shrink: 0;
}

.item-info {
  flex: 1;
}

.item-name {
  font-size: 1rem;
  font-weight: bold;
}

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

.item-aisle-label {
  font-size: 0.8rem;
  color: #888;
  margin-top: 2px;
}

.delete-btn {
  background: none;
  border: none;
  color: #ccc;
  font-size: 1.2rem;
  cursor: pointer;
  padding: 4px;
  flex-shrink: 0;
}

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

/* 売り場アイテム */
.aisle-item {
  display: flex;
  align-items: center;
  gap: 8px;
}

.aisle-order {
  font-size: 0.85rem;
  color: #aaa;
  width: 20px;
  text-align: center;
  flex-shrink: 0;
}

.aisle-name {
  flex: 1;
  font-size: 0.95rem;
}

.aisle-controls {
  display: flex;
  gap: 4px;
}

.aisle-controls button {
  background: #f0f0f0;
  border: 1px solid #ddd;
  border-radius: 4px;
  padding: 4px 8px;
  cursor: pointer;
  font-size: 0.85rem;
}

.aisle-controls button:hover {
  background: #e0e0e0;
}

.aisle-controls button:disabled {
  opacity: 0.3;
  cursor: default;
}

.hint {
  font-size: 0.85rem;
  color: #888;
  margin-bottom: 12px;
}

/* 売り場グループヘッダー */
.aisle-group-header {
  font-size: 0.8rem;
  font-weight: bold;
  color: #2c6e49;
  background: #f0f8f4;
  border: 1px solid #c8e6d4;
  border-radius: 6px;
  margin-bottom: 4px;
  padding: 6px 12px !important;
}

@media (max-width: 375px) {
  h1 {
    font-size: 1.2rem;
  }

  .add-item-form,
  .add-aisle-form {
    gap: 6px;
  }

  .btn-primary {
    width: 100%;
  }
}
