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

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

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

h1 {
  font-size: 1.4rem;
  text-align: center;
  margin-bottom: 20px;
  color: #1a1a2e;
}

h2 {
  font-size: 1rem;
  color: #444;
  margin-bottom: 10px;
}

/* 積載上限セクション */
.limit-section {
  background: #fff;
  border-radius: 10px;
  padding: 14px 16px;
  margin-bottom: 14px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}

.limit-section label {
  font-size: 0.85rem;
  color: #666;
  display: block;
  margin-bottom: 6px;
}

.limit-row {
  display: flex;
  gap: 8px;
}

.limit-row input {
  flex: 1;
  padding: 8px 10px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 0.95rem;
}

.limit-display {
  margin-top: 8px;
  font-size: 0.85rem;
  color: #555;
}

/* 入力セクション */
.input-section {
  background: #fff;
  border-radius: 10px;
  padding: 14px 16px;
  margin-bottom: 14px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}

.input-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.input-row input[type="text"] {
  flex: 2;
  min-width: 120px;
}

.input-row input[type="number"] {
  flex: 1;
  min-width: 90px;
}

.input-row input {
  padding: 8px 10px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 0.95rem;
}

/* ボタン共通 */
button {
  padding: 8px 16px;
  border: none;
  border-radius: 6px;
  font-size: 0.9rem;
  cursor: pointer;
  transition: background 0.15s;
}

#addBtn, #setLimitBtn {
  background: #2196F3;
  color: #fff;
  white-space: nowrap;
}

#addBtn:hover, #setLimitBtn:hover {
  background: #1976D2;
}

/* サマリーセクション */
.summary-section {
  background: #fff;
  border-radius: 10px;
  padding: 14px 16px;
  margin-bottom: 14px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}

.summary-bar {
  display: flex;
  justify-content: space-around;
  margin-bottom: 12px;
}

.summary-item {
  text-align: center;
}

.summary-label {
  display: block;
  font-size: 0.78rem;
  color: #888;
  margin-bottom: 4px;
}

.summary-value {
  font-size: 1.8rem;
  font-weight: 700;
  color: #1a1a2e;
}

.summary-unit {
  font-size: 0.85rem;
  color: #666;
  margin-left: 2px;
}

.progress-container {
  background: #e8ecf0;
  border-radius: 10px;
  height: 14px;
  overflow: hidden;
  margin-bottom: 8px;
}

.progress-bar {
  height: 100%;
  width: 0%;
  background: #2196F3;
  border-radius: 10px;
  transition: width 0.3s, background 0.3s;
}

.progress-bar.over {
  background: #e53935;
}

.progress-bar.warn {
  background: #fb8c00;
}

.status-msg {
  text-align: center;
  font-size: 0.85rem;
  color: #666;
  min-height: 20px;
}

.status-msg.over {
  color: #e53935;
  font-weight: 600;
}

.status-msg.warn {
  color: #fb8c00;
  font-weight: 600;
}

/* リストセクション */
.list-section {
  background: #fff;
  border-radius: 10px;
  padding: 14px 16px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}

.list-section h2 {
  display: flex;
  align-items: center;
  gap: 8px;
}

.count {
  font-size: 0.8rem;
  color: #888;
  font-weight: normal;
}

.item-list {
  list-style: none;
  margin-bottom: 12px;
}

.item-list li {
  display: flex;
  align-items: center;
  padding: 10px 8px;
  border-bottom: 1px solid #f0f0f0;
}

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

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

.item-weight {
  font-size: 0.95rem;
  font-weight: 600;
  color: #2196F3;
  margin-right: 12px;
  min-width: 70px;
  text-align: right;
}

.del-btn {
  background: #f5f5f5;
  color: #e53935;
  padding: 4px 10px;
  font-size: 0.8rem;
  border-radius: 4px;
}

.del-btn:hover {
  background: #ffebee;
}

.empty-msg {
  text-align: center;
  color: #bbb;
  font-size: 0.9rem;
  padding: 20px 0;
}

.clear-btn {
  width: 100%;
  background: #f5f5f5;
  color: #e53935;
  border: 1px solid #ffcdd2;
}

.clear-btn:hover {
  background: #ffebee;
}

/* 積載オーバー時のサマリー強調 */
.summary-section.over .summary-value {
  color: #e53935;
}

.summary-section.warn .summary-value {
  color: #fb8c00;
}
