:root {
  --bg: #fdfaf5;
  --surface: #ffffff;
  --surface-soft: #faf8f4;
  --border: #e8dfd1;
  --text: #1f1d1a;
  --text-muted: #665e54;
  --primary: #c2410c;
  --primary-dark: #9a3412;
  --accent: #0f766e;
  --radius: 14px;
  --shadow: 0 4px 18px rgba(45, 30, 10, 0.06);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Yu Gothic UI", "Hiragino Kaku Gothic ProN", "Meiryo", sans-serif;
  background: var(--bg); color: var(--text); line-height: 1.6; font-size: 15px; overflow-x: hidden;
}
.container { width: 100%; max-width: 1080px; margin: 0 auto; padding: 0 16px; }
.sp-only { display: none; }

.site-header { background: rgba(255,255,255,0.95); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 30; }
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 58px; }
.logo { display: flex; align-items: center; gap: 9px; font-weight: 800; font-size: 15.5px; }
.logo-mark {
  width: 30px; height: 30px; border-radius: 8px;
  background: linear-gradient(135deg, #c2410c, #d97706);
  color: #fff; display: grid; place-items: center; font-size: 15px;
}
.header-nav { display: flex; gap: 16px; }
.header-nav a { text-decoration: none; color: var(--text-muted); font-size: 13.5px; font-weight: 700; }
.header-nav a:hover { color: var(--primary); }

.hero {
  background: linear-gradient(135deg, #9a3412 0%, #c2410c 50%, #d97706 100%);
  color: #fff; padding: 38px 0 42px; text-align: center;
}
.hero-pill {
  display: inline-block; background: rgba(255,255,255,0.2); border: 1px solid rgba(255,255,255,0.4);
  padding: 4px 14px; border-radius: 999px; font-size: 12.5px; font-weight: 800; margin-bottom: 12px;
}
.hero h1 { margin: 0 0 10px; font-size: 30px; line-height: 1.3; font-weight: 900; }
.hero-sub { max-width: 680px; margin: 0 auto; font-size: 14.5px; opacity: 0.95; }

.main-grid { display: grid; grid-template-columns: 1.05fr 0.95fr; gap: 18px; align-items: start; padding: 20px 16px; }
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 20px; box-shadow: var(--shadow); margin-bottom: 16px; min-width: 0; max-width: 100%;
}
.card-header { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.card h2 { margin: 0; font-size: 17px; font-weight: 800; }
.card h3 { margin: 0; font-size: 15px; font-weight: 800; }

.btn-text { background: none; border: none; color: var(--text-muted); font-size: 13px; font-weight: 700; cursor: pointer; }
.btn-text:hover { color: var(--primary); }

.form-block { margin-bottom: 15px; }
.label-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.field-label { display: block; font-size: 13px; font-weight: 700; margin-bottom: 5px; }
.value-badge { background: #ffedd5; color: #9a3412; padding: 2px 11px; border-radius: 999px; font-size: 15px; }
.range-input { width: 100%; accent-color: var(--primary); cursor: pointer; }
.range-scale { display: flex; justify-content: space-between; font-size: 11.5px; color: var(--text-muted); }

.quick-row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.quick-btn {
  border: 1.5px solid var(--border); background: var(--surface-soft); color: var(--text);
  border-radius: 999px; padding: 5px 11px; font-size: 12px; font-weight: 700; cursor: pointer;
}
.quick-btn:hover { border-color: var(--primary); color: var(--primary); background: #fff7ed; }

.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.select-input, .number-input {
  width: 100%; padding: 9px 11px; border: 1.5px solid var(--border);
  border-radius: 9px; font-size: 14px; font-family: inherit; background: var(--surface-soft); color: var(--text);
}
.select-input:focus, .number-input:focus { outline: none; border-color: var(--primary); background: #fff; }
.toggle-check { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--text-muted); font-weight: 600; cursor: pointer; }
.toggle-check input { accent-color: var(--primary); }
.divider { border: none; border-top: 1px solid var(--border); margin: 16px 0; }

.result-column { position: sticky; top: 72px; }
.result-head { text-align: center; margin-bottom: 14px; }
.result-badge {
  display: inline-block; background: #ffedd5; color: #9a3412; border: 1px solid #fed7aa;
  font-size: 12px; font-weight: 800; padding: 3px 13px; border-radius: 999px; margin-bottom: 8px;
}
.big-amount { font-size: 38px; font-weight: 900; color: var(--primary); line-height: 1.15; margin-bottom: 6px; }
.result-sub { margin: 0; font-size: 12.5px; color: var(--text-muted); }

.summary-numbers { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 14px; }
.num-box { background: var(--surface-soft); border: 1px solid var(--border); border-radius: 10px; padding: 11px 9px; text-align: center; }
.num-box.highlight { background: #f0fdfa; border-color: #99f6e4; }
.num-label { display: block; font-size: 11.5px; color: var(--text-muted); font-weight: 700; margin-bottom: 3px; }
.num-val { font-size: 20px; font-weight: 900; }
.num-val.safe { color: var(--accent); }
.num-val.remain { color: var(--primary); }

.plan-box { background: #fff7ed; border: 1px solid #fed7aa; border-radius: 11px; padding: 13px; }
.plan-text { margin: 6px 0 8px; font-size: 13px; font-weight: 700; color: #7c2d12; }
.plan-list { margin: 0; padding-left: 18px; font-size: 12.5px; color: var(--text-muted); }
.plan-list li { margin-bottom: 3px; }

.aff-eyebrow { font-size: 11.5px; font-weight: 800; color: var(--primary); margin-bottom: 4px; }
.aff-list { display: flex; flex-direction: column; gap: 10px; margin-top: 10px; }
.aff-item {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 11px 12px; background: var(--surface-soft); border: 1px solid var(--border); border-radius: 10px;
}
.aff-item strong { display: block; font-size: 13.5px; }
.aff-item p { margin: 2px 0 0; font-size: 12px; color: var(--text-muted); }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 5px;
  border-radius: 9px; font-weight: 700; cursor: pointer; text-decoration: none;
  border: 1.5px solid var(--border); font-family: inherit; white-space: nowrap;
}
.btn-secondary { background: #fff; color: var(--text); }
.btn-sm { padding: 7px 12px; font-size: 12.5px; }

.aff-link-wrap { flex-shrink: 0; display: inline-flex; align-items: center; }
.aff-link-wrap a {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 8px 13px; border-radius: 9px; background: var(--primary); color: #fff;
  text-decoration: none; font-size: 12.5px; font-weight: 700; white-space: nowrap;
}
.aff-link-wrap a:hover { background: var(--primary-dark); }
.aff-link-wrap img { width: 1px; height: 1px; border: 0; }

.info-section { padding-bottom: 10px; }
.table-scroll { overflow-x: auto; }
.guide-table { width: 100%; border-collapse: collapse; font-size: 13px; min-width: 560px; margin-top: 10px; }
.guide-table th, .guide-table td { border: 1px solid var(--border); padding: 9px 10px; text-align: left; }
.guide-table th { background: #ffedd5; color: #9a3412; font-weight: 800; }

.faq-list { display: flex; flex-direction: column; gap: 10px; margin-top: 10px; }
.faq-item { border: 1px solid var(--border); border-radius: 10px; padding: 11px 13px; background: var(--surface-soft); }
.faq-item summary { font-weight: 800; font-size: 14px; cursor: pointer; }
.faq-item p { margin: 8px 0 0; font-size: 13px; color: var(--text-muted); }

.site-footer { margin-top: 18px; background: #1c1917; color: #d6d3d1; padding: 24px 0; font-size: 12px; }
.disclaimer { margin: 0 0 10px; }
.copyright { margin: 0; text-align: center; color: #78716c; }

.toast {
  position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%) translateY(20px);
  background: #1c1917; color: #fff; padding: 10px 18px; border-radius: 999px;
  font-size: 13px; font-weight: 700; opacity: 0; pointer-events: none; transition: opacity 0.2s, transform 0.2s; z-index: 60;
}
.toast.is-visible { opacity: 1; transform: translateX(-50%) translateY(0); }

@media (max-width: 860px) {
  .sp-only { display: inline; }
  .hero h1 { font-size: 22px; }
  .main-grid { grid-template-columns: minmax(0, 1fr); }
  .result-column { position: static; }
  .two-col, .summary-numbers { grid-template-columns: 1fr; }
  .aff-item { flex-direction: column; align-items: flex-start; }
}
