:root {
  --bg: #f5f6fb;
  --surface: #ffffff;
  --surface-soft: #f8fafc;
  --border: #dfe4f0;
  --text: #161d2e;
  --text-muted: #5a667c;
  --primary: #4f46e5;
  --primary-dark: #4338ca;
  --danger: #dc2626;
  --danger-bg: #fef2f2;
  --warn: #b45309;
  --warn-bg: #fffbeb;
  --ok: #15803d;
  --ok-bg: #f0fdf4;
  --radius: 14px;
  --shadow: 0 4px 18px rgba(15, 23, 42, 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, #4f46e5, #7c3aed);
  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, #312e81 0%, #4f46e5 55%, #7c3aed 100%);
  color: #fff; padding: 40px 0 44px; text-align: center;
}
.hero-pill {
  display: inline-block; background: rgba(255,255,255,0.18); border: 1px solid rgba(255,255,255,0.35);
  padding: 4px 14px; border-radius: 999px; font-size: 12.5px; font-weight: 700; 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 20px; font-size: 14.5px; opacity: 0.95; }
.hero-actions { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border-radius: 10px; font-weight: 700; cursor: pointer; text-decoration: none;
  border: 1.5px solid transparent; font-family: inherit;
}
.btn-lg { padding: 11px 20px; font-size: 14.5px; }
.btn-sm { padding: 7px 12px; font-size: 12.5px; }
.btn-primary { background: #fff; color: #312e81; }
.card .btn-primary { background: var(--primary); color: #fff; }
.card .btn-primary:hover { background: var(--primary-dark); }
.btn-outline { background: rgba(255,255,255,0.14); color: #fff; border-color: rgba(255,255,255,0.55); }
.btn-secondary { background: #fff; color: var(--text); border-color: var(--border); }
.btn-secondary:hover { border-color: var(--primary); color: var(--primary); }
.btn-text { background: none; border: none; color: var(--text-muted); font-size: 13px; font-weight: 700; cursor: pointer; margin-left: 8px; }
.btn-chip {
  background: #eef2ff; color: var(--primary); border: 1px solid #c7d2fe;
  border-radius: 999px; padding: 4px 11px; font-size: 12px; font-weight: 700; cursor: pointer;
}

.main-grid { display: grid; grid-template-columns: 1.06fr 0.94fr; 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: 8px; margin-bottom: 12px; flex-wrap: wrap; }
.card h2 { margin: 0; font-size: 17px; font-weight: 800; }
.card h3 { margin: 0; font-size: 15px; font-weight: 800; }

.form-block { margin-bottom: 14px; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.field-label { display: block; font-size: 13px; font-weight: 700; margin-bottom: 4px; }
.field-hint { margin: 4px 0 0; font-size: 12.5px; color: var(--text-muted); }
.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);
}
.number-input:focus { outline: none; border-color: var(--primary); background: #fff; }
.divider { border: none; border-top: 1px solid var(--border); margin: 16px 0; }

.item-box { background: var(--surface-soft); border: 1px solid var(--border); border-radius: 10px; padding: 11px 13px; margin-bottom: 9px; }
.item-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.item-title { display: block; font-size: 13.5px; font-weight: 700; }
.item-desc { margin: 2px 0 0; font-size: 11.8px; color: var(--text-muted); }
.yen-wrap { display: flex; align-items: center; gap: 5px; flex-shrink: 0; }
.yen-input { width: 108px; text-align: right; font-weight: 700; background: #fff; }

.result-column { position: sticky; top: 72px; }
.result-head { text-align: center; margin-bottom: 14px; }
.verdict-badge { display: inline-block; font-size: 12.5px; font-weight: 800; padding: 4px 14px; border-radius: 999px; margin-bottom: 7px; }
.verdict-badge.high { background: var(--danger-bg); color: var(--danger); border: 1px solid #fecaca; }
.verdict-badge.mid { background: var(--warn-bg); color: var(--warn); border: 1px solid #fde68a; }
.verdict-badge.ok { background: var(--ok-bg); color: var(--ok); border: 1px solid #bbf7d0; }
.verdict-title { margin: 0; font-size: 18px !important; line-height: 1.4; }

.summary-numbers { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 10px; }
.num-box { background: var(--surface-soft); border: 1px solid var(--border); border-radius: 10px; padding: 10px 8px; text-align: center; }
.num-box.highlight { background: #fef2f2; border-color: #fecaca; }
.num-label { display: block; font-size: 11px; color: var(--text-muted); font-weight: 700; margin-bottom: 3px; }
.num-val { font-size: 16.5px; font-weight: 900; }
.num-val.months { color: var(--primary); }
.num-val.savings { color: var(--danger); }

.after-bar {
  background: #eef2ff; border: 1px solid #c7d2fe; border-radius: 9px; padding: 9px 12px;
  font-size: 13px; font-weight: 700; color: #312e81; text-align: center;
}

.breakdown-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 7px; }
.breakdown-item { border-radius: 9px; padding: 9px 11px; font-size: 12.5px; border: 1px solid var(--border); background: var(--surface-soft); }
.breakdown-item.is-cut { background: #fef2f2; border-color: #fecaca; }
.breakdown-item.is-ok { background: #f0fdf4; border-color: #bbf7d0; }
.bd-head { display: flex; justify-content: space-between; font-weight: 800; margin-bottom: 2px; gap: 6px; }
.bd-reason { margin: 0; font-size: 11.8px; color: var(--text-muted); }

.mail-textarea {
  width: 100%; min-height: 205px; margin-top: 8px; padding: 10px; border: 1.5px solid var(--border);
  border-radius: 9px; background: var(--surface-soft); color: var(--text);
  font-family: inherit; font-size: 12.5px; line-height: 1.6; resize: vertical;
}

.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.aff-stack {
  flex-direction: column;
  align-items: stretch;
}
.aff-item strong { display: block; font-size: 13.5px; }
.aff-item p { margin: 2px 0 0; font-size: 12px; color: var(--text-muted); }
.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: 9px 13px; border-radius: 9px; background: var(--primary); color: #fff;
  text-decoration: none; font-size: 12.5px; font-weight: 700; text-align: center; line-height: 1.4;
}
.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: #eef2ff; color: #312e81; font-weight: 800; }
.pill { display: inline-block; font-size: 11.5px; font-weight: 800; padding: 2px 8px; border-radius: 999px; white-space: nowrap; }
.pill.easy { background: var(--danger-bg); color: var(--danger); }
.pill.mid { background: var(--warn-bg); color: var(--warn); }

.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: #0f172a; color: #cbd5e1; padding: 24px 0; font-size: 12px; }
.disclaimer { margin: 0 0 10px; }
.copyright { margin: 0; text-align: center; color: #64748b; }

.toast {
  position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%) translateY(20px);
  background: #0f172a; 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; }
  .hero-actions { flex-direction: column; }
  .hero-actions .btn { width: 100%; }
  .main-grid { grid-template-columns: minmax(0, 1fr); }
  .result-column { position: static; }
  .two-col, .summary-numbers { grid-template-columns: 1fr; }
  .item-top { flex-direction: column; align-items: flex-start; }
  .yen-wrap, .yen-input { width: 100%; }
  .aff-item { flex-direction: column; align-items: flex-start; }
}
