:root {
  --primary: #0ea5e9;
  --primary-dark: #0284c7;
  --primary-light: #f0f9ff;
  --green: #059669;
  --green-light: #d1fae5;
  --text: #1f2937;
  --text-light: #6b7280;
  --border: #e5e7eb;
  --white: #ffffff;
  --shadow: 0 2px 8px rgba(0,0,0,0.08);
  --radius: 12px;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: 'Hiragino Sans', 'Meiryo', sans-serif; background: #f9fafb; color: var(--text); line-height: 1.6; }
.container { max-width: 1100px; margin: 0 auto; padding: 0 16px; }

header { background: linear-gradient(135deg, #0369a1 0%, var(--primary) 100%); color: white; padding: 32px 0 28px; text-align: center; }
header h1 { font-size: clamp(1.4rem, 4vw, 2rem); font-weight: 700; margin-bottom: 8px; }
.subtitle { font-size: 0.9rem; opacity: 0.9; }

.calculator-layout { display: grid; grid-template-columns: 1fr 1.1fr; gap: 24px; margin: 32px 0 24px; }
@media (max-width: 768px) { .calculator-layout { grid-template-columns: 1fr; } }

.input-panel, .result-panel { background: var(--white); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); }
.panel-title { font-size: 1.05rem; font-weight: 700; color: var(--primary); margin-bottom: 18px; padding-bottom: 10px; border-bottom: 2px solid var(--primary-light); }

.form-group { margin-bottom: 16px; }
.form-group > label { display: block; font-weight: 600; font-size: 0.9rem; margin-bottom: 6px; }
.input-suffix { display: flex; align-items: center; border: 1.5px solid var(--border); border-radius: 8px; overflow: hidden; transition: border-color 0.2s; }
.input-suffix:focus-within { border-color: var(--primary); }
.suffix { padding: 9px 10px; background: #f3f4f6; color: var(--text-light); font-size: 0.85rem; white-space: nowrap; }
.input-suffix input { flex: 1; border: none; outline: none; padding: 9px 12px; font-size: 0.95rem; width: 100%; }
.input-row { display: flex; gap: 8px; }
.input-suffix.small { flex: 1; }

.btn-calc-payment {
  margin-top: 6px;
  background: none;
  border: 1px solid var(--primary);
  color: var(--primary);
  border-radius: 6px;
  padding: 4px 12px;
  font-size: 0.8rem;
  cursor: pointer;
}
.btn-calc-payment:hover { background: var(--primary); color: white; }

.divider { border: none; border-top: 1px solid var(--border); margin: 18px 0; }

.radio-group { display: flex; flex-direction: column; gap: 8px; }
.radio-label { display: flex; align-items: flex-start; gap: 8px; cursor: pointer; font-size: 0.9rem; }
.radio-label input[type="radio"] { margin-top: 3px; accent-color: var(--primary); }
.radio-text { display: flex; flex-direction: column; }
.radio-text small { color: var(--text-light); font-size: 0.78rem; }

.btn-calc { width: 100%; background: var(--primary); color: white; border: none; border-radius: 10px; padding: 13px; font-size: 1rem; font-weight: 700; cursor: pointer; margin-top: 16px; transition: background 0.2s, transform 0.1s; }
.btn-calc:hover { background: var(--primary-dark); }
.btn-calc:active { transform: scale(0.98); }

.empty-state { text-align: center; color: var(--text-light); padding: 40px 20px; font-size: 0.9rem; }

/* Result */
.result-summary { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 20px; }
.result-card { background: var(--primary-light); border-radius: 10px; padding: 14px; text-align: center; }
.result-card.main { background: var(--primary); color: white; grid-column: 1 / -1; }
.result-card.green { background: var(--green-light); }
.card-label { font-size: 0.78rem; font-weight: 600; opacity: 0.8; margin-bottom: 4px; }
.card-value { font-size: 1.3rem; font-weight: 700; }
.result-card.main .card-value { font-size: 1.6rem; }
.result-card.green .card-value { color: var(--green); }

.new-payment-box { background: #fff7ed; border: 1px solid #fed7aa; border-radius: 10px; padding: 14px 16px; margin-top: 16px; }
.new-payment-box h3 { font-size: 0.9rem; color: #c2410c; margin-bottom: 8px; }
.new-payment-row { display: flex; justify-content: space-between; font-size: 0.88rem; margin-bottom: 4px; }
.new-payment-row .val { font-weight: 700; }

/* Compare */
.compare-section { background: var(--white); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); margin-bottom: 24px; }
.compare-section h2 { font-size: 1.05rem; margin-bottom: 14px; }
.table-wrapper { overflow-x: auto; }
.compare-table { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
.compare-table th { background: var(--primary); color: white; padding: 10px 14px; text-align: center; }
.compare-table td { padding: 10px 14px; border-bottom: 1px solid var(--border); text-align: center; }
.compare-table td:first-child { text-align: left; font-weight: 600; }
.highlight-col { background: #e0f2fe !important; }
.compare-table td.highlight-col { background: #f0f9ff; }
.compare-table .saving-row td { color: var(--green); font-weight: 700; }

/* Chart */
.chart-section { background: var(--white); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); margin-bottom: 24px; }
.chart-section h2 { font-size: 1.05rem; margin-bottom: 14px; }
.chart-wrap canvas { max-height: 300px; }

/* FAQ */
.faq-section { background: var(--white); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); margin-bottom: 32px; }
.faq-section h2 { font-size: 1.05rem; margin-bottom: 14px; }
.faq-item { border-bottom: 1px solid var(--border); }
.faq-item:last-child { border-bottom: none; }
.faq-question { width: 100%; background: none; border: none; text-align: left; padding: 14px 0; font-size: 0.9rem; font-weight: 600; cursor: pointer; display: flex; justify-content: space-between; align-items: center; color: var(--text); gap: 12px; }
.faq-icon { color: var(--primary); font-size: 1.1rem; min-width: 20px; text-align: center; transition: transform 0.2s; }
.faq-question.open .faq-icon { transform: rotate(45deg); }
.faq-answer { display: none; padding: 0 0 14px; font-size: 0.88rem; line-height: 1.7; color: #374151; }
.faq-answer p { margin-bottom: 6px; }

footer { background: #1f2937; color: #9ca3af; padding: 24px 0; text-align: center; }
footer a { color: #9ca3af; text-decoration: underline; margin: 0 6px; }
.disclaimer { font-size: 0.78rem; margin-top: 8px; }
