* {
  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 {
  text-align: center;
  font-size: 1.4rem;
  padding: 16px 0 20px;
  color: #222;
}

h2 {
  font-size: 1rem;
  color: #555;
  margin-bottom: 12px;
}

.card {
  background: #fff;
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 16px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.07);
}

/* 限度額選択 */
.limit-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.radio-label {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  cursor: pointer;
  transition: border-color 0.15s;
  font-size: 0.95rem;
}

.radio-label:hover {
  border-color: #4a90d9;
}

.radio-label input[type="radio"] {
  accent-color: #4a90d9;
  width: 16px;
  height: 16px;
}

#customLimitArea {
  margin-top: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

#customLimitArea label {
  font-size: 0.9rem;
  color: #555;
}

#customLimit {
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 1rem;
  width: 160px;
  transition: border-color 0.15s;
}

#customLimit:focus {
  outline: none;
  border-color: #4a90d9;
}

.hidden {
  display: none !important;
}

/* サマリーカード */
.summary-card {
  background: linear-gradient(135deg, #f0f7ff 0%, #e8f4fd 100%);
}

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

.summary-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.summary-item .label {
  font-size: 0.8rem;
  color: #777;
}

.summary-item .value {
  font-size: 1.1rem;
  font-weight: bold;
  color: #333;
}

.remaining-area {
  text-align: center;
  margin-bottom: 12px;
}

.remaining-label {
  display: block;
  font-size: 0.85rem;
  color: #666;
  margin-bottom: 4px;
}

.remaining-amount {
  display: block;
  font-size: 2rem;
  font-weight: bold;
  color: #2ecc71;
  transition: color 0.3s;
}

.remaining-amount.warning {
  color: #e67e22;
}

.remaining-amount.danger {
  color: #e74c3c;
}

.remaining-amount.over {
  color: #c0392b;
}

/* プログレスバー */
.progress-bar-wrapper {
  background: #e0e0e0;
  border-radius: 8px;
  height: 12px;
  overflow: hidden;
  margin-bottom: 6px;
}

.progress-bar {
  height: 100%;
  width: 0%;
  background: #2ecc71;
  border-radius: 8px;
  transition: width 0.3s, background 0.3s;
}

.progress-bar.warning {
  background: #e67e22;
}

.progress-bar.danger {
  background: #e74c3c;
}

.progress-text {
  text-align: center;
  font-size: 0.8rem;
  color: #888;
}

/* 月別収入グリッド */
.month-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 14px;
}

.month-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.month-item label {
  font-size: 0.82rem;
  color: #666;
}

.month-item input {
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  padding: 7px 10px;
  font-size: 0.95rem;
  width: 100%;
  transition: border-color 0.15s;
}

.month-item input:focus {
  outline: none;
  border-color: #4a90d9;
}

.total-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 4px 0;
  border-top: 1px solid #eee;
  font-size: 1rem;
  font-weight: bold;
}

#yearTotal {
  color: #4a90d9;
}

/* ボタン */
.actions {
  text-align: center;
  margin-bottom: 32px;
}

.btn-secondary {
  background: #fff;
  border: 2px solid #ddd;
  border-radius: 8px;
  padding: 10px 24px;
  font-size: 0.9rem;
  color: #888;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
}

.btn-secondary:hover {
  border-color: #e74c3c;
  color: #e74c3c;
}

@media (max-width: 400px) {
  .summary-row {
    flex-direction: column;
    align-items: center;
  }
  .month-grid {
    grid-template-columns: 1fr;
  }
}
