/* ===== リセット・ベース ===== */
*, *::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-bottom: 80px;
}

/* ===== ヘッダー ===== */
.header {
  background: #4a90d9;
  color: #fff;
  padding: 14px 20px;
  position: sticky;
  top: 0;
  z-index: 10;
}

.header h1 {
  font-size: 1.1rem;
  font-weight: bold;
  margin-bottom: 6px;
}

.summary {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}

#totalCount {
  font-size: 0.82rem;
  opacity: 0.85;
}

.total-amount {
  font-size: 1.3rem;
  font-weight: bold;
  font-variant-numeric: tabular-nums;
}

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

.input-area input[type="text"] {
  width: 100%;
  height: 44px;
  padding: 0 12px;
  font-size: 1rem;
  border: 1px solid #ccc;
  border-radius: 8px;
  background: #f9f9f9;
  outline: none;
}

.input-area input[type="text"]:focus {
  border-color: #4a90d9;
  background: #fff;
}

.amount-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.yen {
  font-size: 1.1rem;
  color: #888;
  flex-shrink: 0;
}

.amount-row input[type="number"] {
  flex: 1;
  height: 44px;
  padding: 0 10px;
  font-size: 1.1rem;
  border: 1px solid #ccc;
  border-radius: 8px;
  background: #f9f9f9;
  outline: none;
  -moz-appearance: textfield;
}

.amount-row input[type="number"]::-webkit-inner-spin-button,
.amount-row input[type="number"]::-webkit-outer-spin-button {
  -webkit-appearance: none;
}

.amount-row input[type="number"]:focus {
  border-color: #4a90d9;
  background: #fff;
}

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

.btn:active { opacity: 0.7; }

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

/* ===== リスト ===== */
.item-list {
  list-style: none;
  padding: 10px 16px 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

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

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

.item-label {
  font-size: 0.95rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: #555;
}

.item-amount {
  font-size: 1.15rem;
  font-weight: bold;
  color: #333;
  font-variant-numeric: tabular-nums;
  margin-top: 2px;
}

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

.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;
}

/* ===== フッターアクション ===== */
.footer-actions {
  padding: 16px;
  display: flex;
  justify-content: flex-end;
}

.btn-clear {
  background: #f0f0f0;
  color: #999;
  font-size: 0.82rem;
  height: 36px;
  padding: 0 14px;
}

/* ===== スマホ調整 ===== */
@media (max-width: 375px) {
  .input-area {
    padding: 12px;
  }

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

  .total-amount {
    font-size: 1.15rem;
  }
}
