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

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

.container {
  max-width: 480px;
  margin: 0 auto;
}

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

.input-section {
  background: #fff;
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  margin-bottom: 20px;
}

.input-group {
  margin-bottom: 16px;
}

label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: #555;
  margin-bottom: 6px;
}

input[type="number"] {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid #ddd;
  border-radius: 8px;
  font-size: 1rem;
  outline: none;
  transition: border-color 0.2s;
}

input[type="number"]:focus {
  border-color: #2ecc71;
}

button#calc-btn {
  width: 100%;
  padding: 14px;
  background: #2ecc71;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s;
  margin-top: 4px;
}

button#calc-btn:hover {
  background: #27ae60;
}

.result-section {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 16px;
}

.result-card {
  background: #fff;
  border-radius: 12px;
  padding: 18px 20px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.result-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: #888;
  margin-bottom: 6px;
}

.result-value {
  font-size: 2rem;
  font-weight: 800;
  color: #2ecc71;
}

.remaining .result-value {
  color: #e67e22;
}

.remaining .result-value.achieved {
  color: #2ecc71;
}

/* プログレスバー */
.progress-bar-card {
  padding: 16px 20px;
}

.progress-bar-bg {
  width: 100%;
  height: 18px;
  background: #eee;
  border-radius: 9px;
  overflow: hidden;
  margin-bottom: 6px;
}

.progress-bar-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #2ecc71, #27ae60);
  border-radius: 9px;
  transition: width 0.5s ease;
}

.progress-bar-fill.over {
  background: linear-gradient(90deg, #f39c12, #e67e22);
}

.progress-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.78rem;
  color: #aaa;
}

/* サマリー */
.summary-card {}

.summary-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid #f0f0f0;
}

.summary-row:last-child {
  border-bottom: none;
}

.summary-label {
  font-size: 0.88rem;
  color: #777;
  font-weight: 600;
}

.summary-val {
  font-size: 1rem;
  font-weight: 700;
  color: #333;
}

.summary-val.positive {
  color: #2ecc71;
}

.summary-val.negative {
  color: #e74c3c;
}

/* リセットボタン */
.reset-btn {
  display: block;
  width: 100%;
  padding: 12px;
  background: transparent;
  border: 1.5px solid #ccc;
  border-radius: 8px;
  font-size: 0.9rem;
  color: #888;
  cursor: pointer;
  transition: all 0.2s;
}

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

@media (min-width: 480px) {
  .result-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }
  .progress-bar-card,
  .summary-card {
    grid-column: 1 / -1;
  }
}
