:root {
  --bg: #f7f8fb;
  --surface: #ffffff;
  --surface-soft: #f8fafc;
  --border: #e2e8f0;
  --text: #182032;
  --text-muted: #5b677c;
  --primary: #e11d48;
  --primary-dark: #be123c;
  --accent: #0f766e;
  --ok-bg: #dcfce7;
  --ok-text: #166534;
  --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, #e11d48, #f97316);
  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, #9f1239 0%, #e11d48 55%, #f97316 100%);
  color: #ffffff;
  padding: 38px 0 42px;
  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; 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); }

.preset-row { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 14px; }
.preset-btn {
  border: 1.5px solid var(--border);
  background: var(--surface-soft);
  color: var(--text);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
}
.preset-btn:hover { border-color: var(--primary); color: var(--primary); background: #fff1f2; }

.dim-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 12px; }
.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, .select-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, .select-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: 18px 0; }

.mode-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-bottom: 12px; }
.mode-btn {
  border: 1.5px solid var(--border); background: var(--surface-soft); color: var(--text-muted);
  border-radius: 9px; padding: 8px; font-size: 12.5px; font-weight: 700; cursor: pointer;
}
.mode-btn.is-active { background: var(--primary); color: #fff; border-color: var(--primary); }

.desc-controls { margin-bottom: 8px; }
.desc-textarea {
  width: 100%; min-height: 150px; 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;
}

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 5px;
  border-radius: 9px; font-weight: 700; cursor: pointer; border: none; font-family: inherit;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-sm { padding: 7px 12px; font-size: 12.5px; }

.result-column { position: sticky; top: 72px; }
.best-badge {
  display: inline-block; background: #fff1f2; color: var(--primary); border: 1px solid #fecdd3;
  font-size: 12px; font-weight: 800; padding: 3px 12px; border-radius: 999px; margin-bottom: 8px;
}
.best-title { margin: 0 0 4px; font-size: 21px !important; color: #0f172a; }
.best-sub { margin: 0 0 14px; font-size: 13px; color: var(--text-muted); }

.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: #ecfdf5; border-color: #a7f3d0; }
.num-label { display: block; font-size: 11px; color: var(--text-muted); font-weight: 700; margin-bottom: 3px; }
.num-val { font-size: 17px; font-weight: 900; }
.num-val.cost { color: var(--primary); }
.num-val.profit { color: var(--accent); }

.rate-pill {
  text-align: center; background: #f1f5f9; border-radius: 8px; padding: 6px;
  font-size: 13px; font-weight: 800; color: #334155;
}

.method-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 7px; }
.method-item {
  border: 1px solid var(--border); border-radius: 10px; padding: 9px 11px;
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
  background: var(--surface-soft); font-size: 13px;
}
.method-item.is-best { background: #fff1f2; border-color: #fda4af; }
.method-name { font-weight: 800; display: block; }
.method-note { font-size: 11.5px; color: var(--text-muted); }
.method-price { font-weight: 900; font-size: 15px; white-space: nowrap; }

.aff-eyebrow { font-size: 11.5px; font-weight: 800; color: var(--primary); margin-bottom: 4px; }
.aff-list { display: flex; flex-direction: column; gap: 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); }
.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: #fff1f2; color: #9f1239; 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: #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); }
.hidden { display: none !important; }

@media (max-width: 860px) {
  .sp-only { display: inline; }
  .hero h1 { font-size: 22px; }
  .header-nav { gap: 10px; }
  .header-nav a { font-size: 12px; }
  .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; }
}
