:root {
  --bg: #f7f8fa;
  --surface: #ffffff;
  --text: #1d2330;
  --muted: #5b6475;
  --line: #e2e6ee;
  --accent: #0f7b6c;
  --accent-weak: #e3f3f0;
  --warn-bg: #fff7e6;
  --warn-line: #f0c36d;
  --radius: 12px;
  --font: "Hiragino Sans", "Noto Sans JP", "Yu Gothic UI", "Meiryo", sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #12151b;
    --surface: #1b2029;
    --text: #e8ebf1;
    --muted: #a3acbd;
    --line: #2c3340;
    --accent: #3cc2ad;
    --accent-weak: #16312d;
    --warn-bg: #2d2717;
    --warn-line: #7a6326;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: var(--font); font-size: 16px; line-height: 1.75;
}
a { color: var(--accent); }
.wrap { max-width: 760px; margin: 0 auto; padding: 0 16px; }

header.site { background: var(--surface); border-bottom: 1px solid var(--line); }
header.site .wrap { display: flex; align-items: center; justify-content: space-between; height: 56px; }
header.site .logo { font-weight: 700; text-decoration: none; color: var(--text); font-size: 17px; }
header.site .logo span { color: var(--accent); }
header.site nav a { margin-left: 16px; font-size: 14px; color: var(--muted); text-decoration: none; }

main { padding: 24px 0 48px; }
h1 { font-size: 24px; line-height: 1.45; margin: 8px 0 8px; }
h2 { font-size: 20px; margin: 40px 0 12px; padding-bottom: 6px; border-bottom: 2px solid var(--line); }
h3 { font-size: 17px; margin: 24px 0 8px; }
.lead { color: var(--muted); margin-top: 0; }
.updated { font-size: 13px; color: var(--muted); }
.breadcrumb { font-size: 13px; color: var(--muted); }
.breadcrumb a { color: var(--muted); }

.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 20px; margin: 16px 0;
}
.form-row { margin-bottom: 16px; }
.form-row label { display: block; font-weight: 600; font-size: 15px; margin-bottom: 6px; }
.form-row .hint { font-size: 13px; color: var(--muted); margin-top: 4px; }
input[type="number"], select {
  width: 100%; padding: 10px 12px; font-size: 17px; font-family: inherit;
  border: 1px solid var(--line); border-radius: 8px; background: var(--bg); color: var(--text);
}
input[type="range"] { width: 100%; accent-color: var(--accent); }
.unit-input { display: flex; align-items: center; gap: 8px; }
.unit-input span { white-space: nowrap; color: var(--muted); }
details.adv summary { cursor: pointer; color: var(--accent); font-size: 14px; margin-bottom: 12px; }

.result { background: var(--accent-weak); border: 1px solid var(--accent); }
.result .big { font-size: 34px; font-weight: 700; color: var(--accent); line-height: 1.3; }
.result .big small { font-size: 16px; font-weight: 600; }
.result .label { font-size: 14px; color: var(--muted); }
.grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-top: 16px; }
.grid .cell { background: var(--surface); border-radius: 8px; padding: 10px 12px; }
.grid .cell b { display: block; font-size: 19px; }
.grid .cell span { font-size: 12px; color: var(--muted); }
.msg { font-size: 14px; margin-top: 12px; }

table { width: 100%; border-collapse: collapse; font-size: 14px; margin: 12px 0; background: var(--surface); }
th, td { border: 1px solid var(--line); padding: 8px 10px; text-align: left; vertical-align: top; }
th { background: var(--bg); font-weight: 600; }
td.num, th.num { text-align: right; white-space: nowrap; }
.table-scroll { overflow-x: auto; }

.note { background: var(--warn-bg); border: 1px solid var(--warn-line); border-radius: 8px; padding: 12px 14px; font-size: 14px; }
.pr { font-size: 12px; color: var(--muted); border: 1px solid var(--line); border-radius: 4px; padding: 0 6px; }
.ad-slot { margin: 24px 0; min-height: 0; }

.tool-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.tool-list a {
  display: block; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px 18px; text-decoration: none; color: var(--text);
}
.tool-list a:hover { border-color: var(--accent); }
.tool-list b { display: block; font-size: 17px; }
.tool-list span { font-size: 14px; color: var(--muted); }
.badge { display: inline-block; font-size: 11px; background: var(--accent); color: #fff; border-radius: 4px; padding: 0 6px; margin-left: 6px; vertical-align: 2px; }

.faq dt { font-weight: 700; margin-top: 16px; }
.faq dd { margin: 4px 0 0; }
.sources { font-size: 13px; color: var(--muted); }

footer.site { border-top: 1px solid var(--line); background: var(--surface); padding: 24px 0; font-size: 13px; color: var(--muted); }
footer.site a { color: var(--muted); margin-right: 14px; }

@media (max-width: 480px) {
  h1 { font-size: 21px; }
  .result .big { font-size: 28px; }
  header.site nav a { margin-left: 10px; }
}
