:root {
  --bg: #f5f7fb;
  --surface: #ffffff;
  --surface-soft: #f8fafc;
  --border: #dfe5f0;
  --text: #162032;
  --text-muted: #5a677d;
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --teal: #0f766e;
  --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.65; 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.96); 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; gap: 10px; }
.logo { display: flex; align-items: center; gap: 9px; font-weight: 800; font-size: 15.5px; text-decoration: none; color: var(--text); }
.logo-mark {
  width: 30px; height: 30px; border-radius: 8px;
  background: linear-gradient(135deg, var(--primary), #0d9488);
  color: #fff; display: grid; place-items: center; font-size: 15px; font-weight: 900;
}
.header-nav { display: flex; gap: 14px; align-items: center; }
.header-nav a { text-decoration: none; color: var(--text-muted); font-size: 13px; font-weight: 700; white-space: nowrap; }
.header-nav a:hover { color: var(--primary); }

.hero {
  background: linear-gradient(135deg, #1e3a8a 0%, #2563eb 52%, #0d9488 100%);
  color: #fff; padding: 38px 0 42px; text-align: center;
}
.hero.theme-indigo { background: linear-gradient(135deg, #312e81 0%, #4f46e5 55%, #0284c7 100%); }
.hero.theme-teal { background: linear-gradient(135deg, #134e4a 0%, #0f766e 55%, #0ea5e9 100%); }
.hero.theme-amber { background: linear-gradient(135deg, #9a3412 0%, #d97706 55%, #f59e0b 100%); }
.hero.theme-rose { background: linear-gradient(135deg, #9f1239 0%, #e11d48 55%, #f97316 100%); }
.hero.theme-slate { background: linear-gradient(135deg, #1e293b 0%, #334155 55%, #0f766e 100%); }
.hero.theme-green { background: linear-gradient(135deg, #14532d 0%, #15803d 55%, #0d9488 100%); }
.hero.theme-violet { background: linear-gradient(135deg, #4c1d95 0%, #7c3aed 55%, #ec4899 100%); }

.hero-pill {
  display: inline-block; background: rgba(255,255,255,0.18); border: 1px solid rgba(255,255,255,0.38);
  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: 700px; 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; flex-wrap: wrap; }
.card h2 { margin: 0; font-size: 17px; font-weight: 800; }
.card h3 { margin: 0; font-size: 15px; font-weight: 800; }

/* ポータル用グリッド */
.portal-section { padding: 22px 16px 6px; }
.sec-heading { margin: 0 0 12px; font-size: 19px; font-weight: 900; border-left: 5px solid var(--primary); padding-left: 11px; }
.tool-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 18px; }
.tool-card {
  background: var(--surface); border: 1.5px solid var(--border); border-radius: var(--radius);
  padding: 16px; text-decoration: none; color: var(--text); box-shadow: var(--shadow);
  display: flex; flex-direction: column; justify-content: space-between; transition: transform 0.12s, border-color 0.15s;
}
.tool-card:hover { transform: translateY(-2px); border-color: var(--primary); }
.tool-badge {
  display: inline-block; font-size: 11px; font-weight: 800; padding: 2px 9px; border-radius: 999px;
  background: #eff6ff; color: var(--primary); margin-bottom: 8px; width: fit-content;
}
.tool-card h3 { margin: 0 0 6px; font-size: 15.5px; line-height: 1.35; }
.tool-card p { margin: 0 0 12px; font-size: 12.8px; color: var(--text-muted); }
.tool-cta { font-size: 12.5px; font-weight: 800; color: var(--primary); }

/* フォーム共通 */
.form-block { margin-bottom: 14px; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.label-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 5px; }
.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); }
.value-badge { background: #eff6ff; color: var(--primary); padding: 2px 11px; border-radius: 999px; font-size: 14.5px; font-weight: 800; }
.range-input { width: 100%; accent-color: var(--primary); cursor: pointer; }
.range-scale { display: flex; justify-content: space-between; font-size: 11px; 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; }
.divider { border: none; border-top: 1px solid var(--border); margin: 16px 0; }
.btn-text { background: none; border: none; color: var(--text-muted); font-size: 13px; font-weight: 700; cursor: pointer; }
.btn-text:hover { color: var(--danger); }

.check-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.check-card {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 9px 11px; border: 1.5px solid var(--border); border-radius: 9px;
  background: var(--surface-soft); font-size: 12.8px; font-weight: 700; cursor: pointer;
}
.check-card label { display: flex; align-items: center; gap: 6px; cursor: pointer; }
.check-card input[type="checkbox"] { accent-color: var(--primary); }
.check-price { font-size: 12px; color: var(--text-muted); white-space: nowrap; }

/* 結果共通 */
.result-column { position: sticky; top: 72px; }
.result-head { text-align: center; margin-bottom: 14px; }
.status-pill { display: inline-block; font-size: 12px; font-weight: 800; padding: 3px 13px; border-radius: 999px; margin-bottom: 8px; }
.status-pill.ok { background: var(--ok-bg); color: var(--ok); border: 1px solid #bbf7d0; }
.status-pill.warn { background: var(--warn-bg); color: var(--warn); border: 1px solid #fde68a; }
.status-pill.danger { background: var(--danger-bg); color: var(--danger); border: 1px solid #fecaca; }
.big-num { font-size: 36px; font-weight: 900; color: var(--primary); line-height: 1.15; margin-bottom: 5px; }
.big-num.teal { color: var(--teal); }
.big-num.danger { color: var(--danger); }
.result-sub { margin: 0; font-size: 12.5px; color: var(--text-muted); }

.summary-numbers { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 12px; }
.summary-numbers.cols-2 { grid-template-columns: 1fr 1fr; }
.num-box { background: var(--surface-soft); border: 1px solid var(--border); border-radius: 10px; padding: 10px 8px; text-align: center; }
.num-box.highlight { background: #eff6ff; border-color: #bfdbfe; }
.num-box.highlight-ok { background: #ecfdf5; border-color: #a7f3d0; }
.num-box.highlight-danger { 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: 17px; font-weight: 900; }

.detail-list { list-style: none; padding: 0; margin: 10px 0 0; display: flex; flex-direction: column; gap: 7px; }
.detail-item {
  border: 1px solid var(--border); border-radius: 9px; padding: 9px 11px;
  background: var(--surface-soft); font-size: 12.5px;
}
.detail-head { display: flex; justify-content: space-between; font-weight: 800; gap: 8px; }
.detail-desc { margin: 2px 0 0; font-size: 11.8px; color: var(--text-muted); }

/* 棒グラフバー */
.bar-group { margin: 12px 0; }
.bar-row { margin-bottom: 8px; }
.bar-meta { display: flex; justify-content: space-between; font-size: 12px; font-weight: 700; margin-bottom: 3px; }
.bar-bg { height: 12px; background: #e2e8f0; border-radius: 999px; overflow: hidden; }
.bar-fill { height: 100%; border-radius: 999px; background: var(--primary); transition: width 0.25s; }
.bar-fill.teal { background: var(--teal); }
.bar-fill.amber { background: #d97706; }

/* PR枠 */
.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: 8px 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; }

.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-secondary:hover { border-color: var(--primary); color: var(--primary); }
.btn-sm { padding: 7px 12px; font-size: 12.5px; }

/* FAQ・フッター */
.info-section { padding: 0 16px 10px; }
.faq-list { display: flex; flex-direction: column; gap: 9px; 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: 7px 0 0; font-size: 13px; color: var(--text-muted); }

.other-tools { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.other-chip {
  text-decoration: none; font-size: 12.5px; font-weight: 700; color: var(--text);
  background: var(--surface-soft); border: 1px solid var(--border); border-radius: 999px; padding: 6px 13px;
}
.other-chip:hover { border-color: var(--primary); color: var(--primary); }

.site-footer { margin-top: 24px; background: #0f172a; color: #cbd5e1; padding: 26px 0; font-size: 12px; }
.footer-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 14px; margin-bottom: 12px; }
.footer-links a { color: #94a3b8; text-decoration: none; font-weight: 600; }
.footer-links a:hover { color: #fff; }
.disclaimer { margin: 0 0 10px; line-height: 1.65; }
.copyright { margin: 0; text-align: center; color: #64748b; }

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