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

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

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

h1 {
  font-size: 1.4rem;
  font-weight: 700;
  color: #1a3a5c;
  margin-bottom: 4px;
}

.subtitle {
  font-size: 0.85rem;
  color: #666;
  margin-bottom: 20px;
}

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

h2 {
  font-size: 1rem;
  font-weight: 600;
  color: #1a3a5c;
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 2px solid #e0e8f0;
}

.form-group {
  margin-bottom: 14px;
}

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

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

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

button {
  width: 100%;
  padding: 13px;
  background: #3a7bd5;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  margin-top: 4px;
  transition: background 0.2s;
}

button:hover {
  background: #2a5fb5;
}

/* Result */
.result-grid {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}

.result-block {
  flex: 1;
  text-align: center;
  padding: 14px 10px;
  border-radius: 10px;
}

.result-block.current {
  background: #eef4ff;
  border: 1px solid #c5d8f5;
}

.result-block.after {
  background: #fff3e0;
  border: 1px solid #f5c87a;
}

.result-label {
  font-size: 0.78rem;
  color: #666;
  margin-bottom: 6px;
}

.result-value {
  font-size: 1.6rem;
  font-weight: 700;
  color: #1a3a5c;
  line-height: 1.2;
}

.result-value small {
  font-size: 0.75rem;
  font-weight: 400;
  color: #666;
}

.result-sub {
  font-size: 0.78rem;
  color: #666;
  margin-top: 4px;
}

.arrow {
  font-size: 1.5rem;
  color: #aaa;
  flex-shrink: 0;
}

.diff-box {
  background: #f8f9fa;
  border-radius: 10px;
  padding: 14px 16px;
}

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

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

.diff-label {
  font-size: 0.88rem;
  color: #555;
}

.diff-value {
  font-size: 1rem;
  font-weight: 700;
  color: #d9400a;
}

/* Scenario table */
.scenario-card table {
  width: 100%;
  border-collapse: collapse;
}

th {
  background: #eef4ff;
  padding: 10px 8px;
  font-size: 0.82rem;
  text-align: right;
  color: #444;
  border-bottom: 2px solid #c5d8f5;
}

th:first-child { text-align: left; }

td {
  padding: 10px 8px;
  font-size: 0.9rem;
  text-align: right;
  border-bottom: 1px solid #eee;
}

td:first-child { text-align: left; font-weight: 600; }

tr.highlight td {
  background: #fff8ee;
  color: #d9400a;
  font-weight: 700;
}

@media (max-width: 400px) {
  h1 { font-size: 1.2rem; }
  .result-value { font-size: 1.3rem; }
  .arrow { font-size: 1.2rem; }
}
