:root {
  --fg: #1f2933;
  --muted: #5f6b7a;
  --bg: #ffffff;
  --panel: #f5f7fa;
  --line: #dde3ea;
  --accent: #0b6e4f;
  --accent-weak: #e6f4ef;
  --radius: 10px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  margin: 0;
  color: var(--fg);
  background: var(--bg);
  font-family: system-ui, -apple-system, "Hiragino Sans", "Noto Sans JP", "Yu Gothic UI", sans-serif;
  line-height: 1.75;
}

a { color: var(--accent); }

.wrap { max-width: 760px; margin: 0 auto; padding: 0 16px; }

header.site { border-bottom: 1px solid var(--line); }
header.site .wrap { display: flex; align-items: center; justify-content: space-between; min-height: 56px; }
header.site .logo { white-space: nowrap; font-weight: 700; color: var(--fg); text-decoration: none; }
header.site nav a { white-space: nowrap; margin-left: 16px; font-size: 0.9rem; color: var(--muted); text-decoration: none; }

main { padding: 24px 0 48px; }

h1 { font-size: 1.6rem; line-height: 1.4; margin: 0 0 8px; }
h2 { font-size: 1.2rem; margin: 40px 0 12px; padding-bottom: 4px; border-bottom: 2px solid var(--accent-weak); }
h3 { font-size: 1rem; margin: 24px 0 8px; }
.lead { color: var(--muted); margin-top: 0; }

.breadcrumb { font-size: 0.8rem; color: var(--muted); margin-bottom: 12px; }

/* 計算フォーム */
.tool {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  margin: 20px 0;
}
.field { margin-bottom: 14px; }
.field label { display: block; font-weight: 600; font-size: 0.92rem; margin-bottom: 4px; }
.field .hint { font-size: 0.8rem; color: var(--muted); }
input[type="text"], input[type="number"], select {
  width: 100%;
  font-size: 1.1rem;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}
input:focus, select:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.choices > label:first-child { display: block; font-weight: 600; margin: 0 0 4px; }
.choices label:not(:first-child) { display: inline-flex; align-items: center; gap: 4px; margin-right: 16px; font-weight: 400; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* 結果 */
.result {
  margin-top: 16px;
  background: #fff;
  border: 2px solid var(--accent);
  border-radius: var(--radius);
  padding: 16px;
}
.result .main { font-size: 1.6rem; font-weight: 700; color: var(--accent); }
.result table { width: 100%; border-collapse: collapse; margin-top: 8px; }
.result th, .result td { padding: 6px 4px; border-bottom: 1px solid var(--line); text-align: left; }
.result td { text-align: right; font-variant-numeric: tabular-nums; }
.result tr.total th, .result tr.total td { font-weight: 700; border-bottom: none; }
.note { font-size: 0.82rem; color: var(--muted); }

/* ツール一覧 */
.cards { list-style: none; padding: 0; display: grid; gap: 12px; }
.cards a {
  display: block;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  text-decoration: none;
  color: var(--fg);
}
.cards a:hover { border-color: var(--accent); }
.cards strong { display: block; color: var(--accent); }
.cards span { font-size: 0.88rem; color: var(--muted); }

/* アフィリエイト枠 */
.affiliate { border: 1px dashed var(--line); border-radius: var(--radius); padding: 16px; margin: 32px 0; }
.affiliate h2 { margin-top: 0; border: none; font-size: 1rem; }
.affiliate ul { margin: 0; padding-left: 1.2em; }
.affiliate li span { display: block; font-size: 0.82rem; color: var(--muted); }
.pr-label { display: inline-block; margin: 0 0 4px; font-size: 0.72rem; padding: 0 6px; border: 1px solid var(--muted); border-radius: 4px; color: var(--muted); }

/* FAQ */
details { border-bottom: 1px solid var(--line); padding: 10px 0; }
summary { cursor: pointer; font-weight: 600; }

table.ref { border-collapse: collapse; width: 100%; font-size: 0.92rem; }
table.ref th, table.ref td { border: 1px solid var(--line); padding: 6px 8px; }
table.ref th { background: var(--panel); }

footer.site { border-top: 1px solid var(--line); padding: 20px 0 32px; font-size: 0.82rem; color: var(--muted); }
footer.site a { color: var(--muted); margin-right: 12px; }

@media (max-width: 520px) {
  .row { grid-template-columns: 1fr; }
  header.site nav a { margin-left: 10px; }
  header.site nav a[href$="about"] { display: none; }
}

/* ボタン */
button.copy {
  margin-top: 12px;
  font-size: 0.95rem;
  padding: 8px 16px;
  border: 1px solid var(--accent);
  border-radius: 8px;
  background: var(--accent-weak);
  color: var(--accent);
  cursor: pointer;
}
button.copy:hover { background: #d4ece3; }

/* 判定結果 */
.verdict { font-size: 1.4rem; font-weight: 700; }
.verdict.yes { color: #b4441b; }
.verdict.no { color: var(--accent); }
.result ul { margin: 8px 0 0; padding-left: 1.2em; }

/* 比較表（狭い画面でも金額を折り返さない） */
.result table.compare { font-size: 0.88rem; }
.result table.compare td { white-space: nowrap; }
