:root {
  --bg: #f4f5f3;
  --card: #ffffff;
  --ink: #1d2129;
  --muted: #5b6470;
  --accent: #e8590c; /* 安全オレンジ系 */
  --accent-dark: #c24e02;
  --line: #d9dce1;
  --result-bg: #fff4ec;
  --ok: #137547;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Kaku Gothic ProN",
    "Hiragino Sans", "Noto Sans JP", "Yu Gothic", sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.65;
  font-size: 16px;
}
a { color: var(--accent-dark); }
header.site {
  background: #23272e;
  color: #fff;
  padding: 14px 16px;
}
header.site .site-name { font-weight: 700; font-size: 18px; color: #fff; text-decoration: none; }
header.site .site-sub { display: block; font-size: 12px; color: #b9c0c9; margin-top: 2px; }
main { max-width: 760px; margin: 0 auto; padding: 16px; }
h1 { font-size: 24px; line-height: 1.35; margin: 8px 0 6px; }
h2 { font-size: 19px; margin: 28px 0 8px; padding-left: 10px; border-left: 5px solid var(--accent); }
h3 { font-size: 16px; margin: 18px 0 6px; }
.lead { color: var(--muted); margin: 0 0 16px; }
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 16px;
  margin: 14px 0;
}
.tool-list { display: grid; gap: 12px; grid-template-columns: 1fr; }
@media (min-width: 560px) { .tool-list { grid-template-columns: 1fr 1fr; } }
.tool-card { display: block; text-decoration: none; color: var(--ink); }
.tool-card:hover { border-color: var(--accent); }
.tool-card .t-name { font-weight: 700; font-size: 18px; }
.tool-card .t-desc { color: var(--muted); font-size: 14px; margin-top: 4px; }
label { display: block; font-weight: 600; margin: 14px 0 4px; font-size: 15px; }
label .unit { color: var(--muted); font-weight: 400; font-size: 13px; }
input[type="number"], input[type="text"], select {
  width: 100%;
  font-size: 17px; /* iOSの自動ズーム防止に16px以上 */
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  min-height: 48px;
}
input:focus, select:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.row3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }
@media (max-width: 480px) { .row3 { grid-template-columns: 1fr 1fr; } }
button.calc-btn {
  width: 100%;
  margin-top: 18px;
  padding: 14px;
  font-size: 18px;
  font-weight: 700;
  color: #fff;
  background: var(--accent);
  border: none;
  border-radius: 8px;
  min-height: 52px;
  cursor: pointer;
}
button.calc-btn:active { background: var(--accent-dark); }
.preset-btns { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.preset-btns button {
  padding: 8px 12px; font-size: 14px; border: 1px solid var(--line);
  background: #fff; border-radius: 999px; cursor: pointer; min-height: 40px;
}
.preset-btns button:active { border-color: var(--accent); color: var(--accent-dark); }
.result {
  background: var(--result-bg);
  border: 1px solid #f3c9a8;
  border-radius: 10px;
  padding: 14px 16px;
  margin-top: 16px;
}
.result .r-label { font-size: 13px; color: var(--muted); }
.result .r-main { font-size: 30px; font-weight: 800; line-height: 1.3; }
.result table { width: 100%; border-collapse: collapse; margin-top: 8px; }
.result th, .result td { text-align: left; padding: 6px 4px; border-bottom: 1px solid #f0d7c2; font-size: 15px; }
.result td { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.error { color: #b02a1e; font-weight: 600; margin-top: 12px; }
.hint { font-size: 13px; color: var(--muted); margin-top: 4px; }
table.data { width: 100%; border-collapse: collapse; margin: 10px 0; font-size: 14px; }
table.data th, table.data td { border: 1px solid var(--line); padding: 6px 8px; text-align: right; }
table.data th { background: #eef0f2; text-align: center; }
table.data td:first-child, table.data th:first-child { text-align: left; }
.formula {
  background: #eef0f2; border-radius: 8px; padding: 10px 14px;
  font-family: "SFMono-Regular", Consolas, monospace; font-size: 14px; overflow-x: auto;
}
.funnel {
  border: 2px dashed var(--accent);
  background: #fff;
  border-radius: 10px;
  padding: 16px;
  margin: 26px 0;
}
.funnel .f-title { font-weight: 700; font-size: 17px; }
footer.site {
  max-width: 760px; margin: 0 auto; padding: 20px 16px 40px;
  color: var(--muted); font-size: 13px;
}
.backlink { display: inline-block; margin: 6px 0 2px; font-size: 14px; }
.note-list { padding-left: 20px; }
.note-list li { margin: 4px 0; }
