/* ツール箱 共通デザイン v3（外部フォント・外部ライブラリ不使用） */
:root {
  --ink: #1f2430;
  --muted: #626a78;
  --faint: #9aa3b2;
  --accent: #2f54c9;
  --accent-dark: #223f9e;
  --accent-tint: #edf1fd;
  --accent-line: #ccd8f8;
  --grad: linear-gradient(135deg, #4070e8 0%, #2f54c9 55%, #27439f 100%);
  --line: #e4e2db;
  --line-strong: #c6cbd6;
  --bg: #f3f1ea;
  --surface: #ffffff;
  --field: #fbfcfe;
  --r-lg: 20px;
  --r-md: 14px;
  --r-sm: 10px;
  --shadow: 0 1px 2px rgba(31, 36, 48, .05), 0 14px 36px rgba(31, 36, 48, .09);
  --shadow-lift: 0 2px 4px rgba(31, 36, 48, .06), 0 16px 32px rgba(47, 84, 201, .16);
}
* { box-sizing: border-box; }
::selection { background: #c3d2fb; }
html { background: var(--bg); }
body {
  font-family: system-ui, -apple-system, "Hiragino Kaku Gothic ProN", "Noto Sans JP", sans-serif;
  margin: 30px auto 48px;
  max-width: 800px;
  padding: 40px 44px 48px;
  color: var(--ink);
  background: var(--surface);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow);
  line-height: 1.75;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}
@media (max-width: 860px) {
  html { background: var(--surface); }
  body { margin: 0 auto; border-radius: 0; box-shadow: none; padding: 22px 18px 40px; }
}

/* ---------- 共通ヘッダー（道具ページ） ---------- */
header.site-header { margin-bottom: 22px; }
header.site-header .site-name { font-size: .95rem; font-weight: 700; margin: 0; letter-spacing: .05em; }
header.site-header .site-name a {
  color: var(--muted);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
header.site-header .site-name a::before {
  content: "";
  width: 22px; height: 22px;
  border-radius: 7px;
  background: var(--grad);
  box-shadow: 0 2px 6px rgba(47, 84, 201, .35);
}
header.site-header .site-name a:hover { color: var(--accent); }

/* ---------- 見出し ---------- */
h1 {
  font-size: 1.7rem;
  margin: 0 0 18px;
  line-height: 1.35;
  letter-spacing: .01em;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 12px;
}
h1 .icon-chip {
  flex: 0 0 auto;
  width: 46px; height: 46px;
  border-radius: 13px;
  background: var(--accent-tint);
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
h1 .icon-chip svg { width: 26px; height: 26px; }
h2 {
  font-size: 1.12rem;
  margin: 32px 0 10px;
  line-height: 1.5;
  font-weight: 700;
}
h2.sec {
  font-size: .92rem;
  letter-spacing: .08em;
  color: var(--muted);
  margin: 30px 0 8px;
  display: flex;
  align-items: center;
  gap: 10px;
}
h2.sec::after { content: ""; flex: 1; height: 1px; background: var(--line); }
p.lead { margin: 0 0 18px; color: var(--muted); }
a { color: var(--accent); }
a:hover { color: var(--accent-dark); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }

/* ---------- トップ：ヒーロー ---------- */
.hero { text-align: left; margin-bottom: 8px; }
.hero .logo {
  width: 62px; height: 62px;
  border-radius: 17px;
  background: var(--grad);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 20px rgba(47, 84, 201, .32);
  margin-bottom: 14px;
}
.hero .logo svg { width: 34px; height: 34px; }
.hero h1 { font-size: 2.1rem; margin: 0 0 4px; display: block; }
.hero .tagline { color: var(--muted); margin: 0; font-size: 1.02rem; }
.hero .trust {
  display: inline-block;
  margin-top: 12px;
  font-size: .8rem;
  font-weight: 600;
  color: var(--accent-dark);
  background: var(--accent-tint);
  border: 1px solid var(--accent-line);
  padding: 3px 11px;
  border-radius: 999px;
}

/* ---------- トップ：道具ランチャー ---------- */
.tools {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(228px, 1fr));
  gap: 12px;
  margin: 22px 0 6px;
}
a.tool-card {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 16px 16px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: #fff;
  text-decoration: none;
  color: var(--ink);
  position: relative;
  transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
}
a.tool-card:hover {
  transform: translateY(-2px);
  border-color: var(--accent-line);
  box-shadow: var(--shadow-lift);
  color: var(--ink);
}
a.tool-card .tool-icon {
  flex: 0 0 auto;
  width: 44px; height: 44px;
  border-radius: 12px;
  background: var(--accent-tint);
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background .16s ease, color .16s ease;
}
a.tool-card:hover .tool-icon { background: var(--accent); color: #fff; }
a.tool-card .tool-icon svg { width: 24px; height: 24px; }
a.tool-card .tool-name { font-weight: 700; font-size: 1.02rem; line-height: 1.4; }
a.tool-card .tool-desc { font-size: .83rem; color: var(--muted); line-height: 1.5; margin-top: 1px; }
a.tool-card::after {
  content: "›";
  margin-left: auto;
  font-size: 1.3rem;
  color: var(--faint);
  flex: 0 0 auto;
}
a.tool-card:hover::after { color: var(--accent); }
.coming { margin: 18px 0 0; font-size: .85rem; color: var(--faint); line-height: 1.9; }
.coming .coming-label {
  display: inline-block;
  font-weight: 700;
  color: var(--faint);
  border: 1px dashed var(--line-strong);
  border-radius: 999px;
  padding: 0 9px;
  margin-right: 8px;
  font-size: .78rem;
}

/* ---------- 入力部品 ---------- */
textarea, input, select {
  font-size: 16px;
  font-family: inherit;
  padding: 11px 13px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-sm);
  background: var(--field);
  color: var(--ink);
  transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}
textarea::placeholder, input::placeholder { color: var(--faint); }
textarea:focus, input:focus, select:focus {
  outline: none;
  background: #fff;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(47, 84, 201, .16);
}
textarea { width: 100%; min-height: 150px; line-height: 1.7; resize: vertical; }
input[type="number"] { width: 7.5em; }
input[type="date"] { min-height: 46px; }
input[type="radio"], input[type="checkbox"] { accent-color: var(--accent); margin-right: 6px; width: 1.05em; height: 1.05em; vertical-align: -2px; }
label { display: block; margin: 12px 0 5px; font-weight: 600; font-size: .92rem; }
label.inline, .options label { display: block; font-weight: 400; font-size: .98rem; margin: 8px 0; cursor: pointer; }
.options { margin: 16px 0; }
.options .opt-title {
  font-weight: 700;
  font-size: .85rem;
  letter-spacing: .06em;
  color: var(--muted);
  margin: 18px 0 4px;
}
button {
  font-size: 1rem;
  font-family: inherit;
  font-weight: 600;
  padding: 10px 22px;
  min-height: 46px;
  border-radius: var(--r-sm);
  border: 1px solid var(--line-strong);
  background: #fff;
  color: var(--ink);
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease, box-shadow .15s ease, transform .1s ease;
}
button:hover { background: #f2f4f9; border-color: var(--faint); }
button:active { transform: translateY(1px); }
button.primary {
  background: var(--grad);
  border: none;
  color: #fff;
  box-shadow: 0 3px 10px rgba(47, 84, 201, .3);
}
button.primary:hover { background: var(--grad); filter: brightness(1.07); box-shadow: 0 5px 14px rgba(47, 84, 201, .36); }
button + button { margin-left: 8px; }
.row { display: flex; flex-wrap: wrap; gap: 12px; align-items: end; }
.row > div { flex: 0 1 auto; }

/* ---------- 結果表示 ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin: 16px 0; }
.card {
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 13px 16px 11px;
  background: var(--field);
}
.card .n { font-size: 1.6rem; font-weight: 800; color: var(--ink); line-height: 1.3; font-variant-numeric: tabular-nums; }
.card .l { font-size: .82rem; color: var(--muted); margin-top: 1px; }
.card.main {
  grid-column: span 2;
  background: var(--grad);
  border: none;
  color: #fff;
  box-shadow: 0 6px 16px rgba(47, 84, 201, .28);
}
.card.main .n { color: #fff; font-size: 2rem; }
.card.main .l { color: rgba(255, 255, 255, .85); }
@media (max-width: 560px) { .card.main { grid-column: span 1; } }
.result-box {
  border: 1px solid var(--accent-line);
  border-radius: var(--r-md);
  padding: 16px 18px;
  margin: 14px 0;
  background: var(--accent-tint);
  font-size: 1.05rem;
  line-height: 1.7;
}
.result-box .big { font-size: 1.45rem; font-weight: 800; color: var(--accent-dark); }
.error { color: #b91c1c; font-weight: 600; }
.note { font-size: .88rem; color: var(--muted); min-height: 1.2em; }

/* ---------- 定義（畳んだ開示） ---------- */
details.spec {
  margin-top: 34px;
  border-top: 1px solid var(--line);
  padding-top: 10px;
  font-size: .9rem;
  color: var(--muted);
}
details.spec summary {
  cursor: pointer;
  font-weight: 600;
  font-size: .88rem;
  color: var(--muted);
  list-style: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 0;
}
details.spec summary::-webkit-details-marker { display: none; }
details.spec summary::after { content: "›"; transform: rotate(90deg); display: inline-block; transition: transform .15s ease; color: var(--faint); }
details.spec[open ] summary::after { transform: rotate(-90deg); }
details.spec summary:hover { color: var(--accent); }
.defs { padding-left: 1.35em; margin: 8px 0; }
.defs li { margin: 4px 0; }
table.defs-table {
  border-collapse: separate;
  border-spacing: 0;
  font-size: .9rem;
  margin: 10px 0;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  overflow: hidden;
}
table.defs-table th, table.defs-table td { border-bottom: 1px solid var(--line); padding: 6px 12px; text-align: left; }
table.defs-table th { background: var(--accent-tint); font-weight: 600; color: var(--ink); }
table.defs-table tr:last-child td { border-bottom: none; }

/* ---------- トップ：カテゴリ見出し ---------- */
.cat-head {
  font-size: 1.15rem;
  font-weight: 800;
  margin: 38px 0 2px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.cat-head::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.cat-head:first-of-type { margin-top: 24px; }

/* ---------- フッター ---------- */
footer.site-footer { margin-top: 44px; padding-top: 16px; border-top: 1px solid var(--line); font-size: .87rem; color: var(--muted); }
footer.site-footer a { color: var(--muted); }
footer.site-footer a:hover { color: var(--accent); }
footer.site-footer .sister { margin: 10px 0 0; }
footer.site-footer .sister a { color: var(--muted); text-decoration: underline; text-underline-offset: 3px; }
footer.site-footer .sister a:hover { color: var(--accent); }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
