:root {
  --bg: #fafafa;
  --surface: #fff;
  --text: #222;
  --text-dim: #6b6b6b;
  --accent: #2f6fed;
  --accent-soft: #eaf1ff;
  --border: #e4e4e4;
  --header-bg: #1c2333;
  --header-text: #f5f6fa;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: "Hiragino Sans", "Yu Gothic", "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.8;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.page-inner { max-width: 780px; margin: 0 auto; padding: 32px 20px 60px; }

/* ── ヘッダー ── */

.site-header {
  background: var(--header-bg);
  color: var(--header-text);
}

.header-inner {
  max-width: 960px;
  margin: 0 auto;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
}

.site-logo {
  font-size: 18px;
  font-weight: 700;
  color: var(--header-text);
  letter-spacing: 0.02em;
}

.site-logo:hover { text-decoration: none; opacity: 0.85; }

.site-nav { display: flex; gap: 16px; flex-wrap: wrap; }

.site-nav a {
  color: rgba(245, 246, 250, 0.85);
  font-size: 13px;
}

.site-nav a:hover { color: #fff; text-decoration: none; }

.site-search {
  position: relative;
  margin-left: auto;
  width: 220px;
}

.site-search input {
  width: 100%;
  padding: 7px 12px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  font-size: 13px;
}

.site-search input::placeholder { color: rgba(245, 246, 250, 0.6); }
.site-search input:focus { outline: none; background: rgba(255, 255, 255, 0.18); }

.search-results {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
  max-height: 320px;
  overflow-y: auto;
  z-index: 10;
}

.search-result-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
}

.search-result-item:last-child { border-bottom: none; }
.search-result-item:hover { background: var(--accent-soft); text-decoration: none; }
.search-result-item strong { font-size: 13px; }
.search-result-item span { font-size: 12px; color: var(--text-dim); }
.search-empty { padding: 12px 14px; font-size: 13px; color: var(--text-dim); }

/* ── パンくず ── */

.breadcrumbs {
  font-size: 12px;
  color: var(--text-dim);
  margin-bottom: 20px;
}

.breadcrumbs a { color: var(--text-dim); }
.breadcrumbs a:hover { color: var(--accent); }
.breadcrumbs [aria-current="page"] { color: var(--text); }
.crumb-sep { margin: 0 4px; }

/* ── カテゴリタグ ── */

.category-tag {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 11px;
  font-weight: 600;
}

.category-tag:hover { text-decoration: none; opacity: 0.8; }

.tag-chip {
  display: inline-block;
  padding: 2px 10px;
  margin-left: 6px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-dim);
  font-size: 11px;
}

.card-tags { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.card-tags .tag-chip { margin-left: 0; }

/* ── カード一覧 ── */

.page-title { font-size: 22px; margin-bottom: 20px; }

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 20px;
}

.card {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  color: var(--text);
}

.card:hover { border-color: var(--accent); text-decoration: none; box-shadow: 0 6px 18px rgba(0, 0, 0, 0.06); }

.card-thumb {
  height: 120px;
  width: 100%;
  display: block;
  object-fit: cover;
  background: linear-gradient(135deg, var(--accent-soft), #dfe7fb);
}

.card-body { padding: 14px 16px 18px; display: flex; flex-direction: column; gap: 8px; }
.card-body .category-tag { align-self: flex-start; }
.card h2 { font-size: 15px; margin: 0; line-height: 1.5; }
.card p { font-size: 13px; color: var(--text-dim); margin: 0; }

.empty { color: var(--text-dim); }

/* ── 記事本文 ── */

.article-category { margin-bottom: 10px; }
.article h1 { font-size: 26px; line-height: 1.5; margin: 0 0 6px; }
.article-meta { color: var(--text-dim); font-size: 12px; margin-bottom: 28px; }

.article-hero-figure { margin: 0 0 32px; }

.article-hero {
  width: 100%;
  max-height: 380px;
  object-fit: cover;
  border-radius: 12px;
  display: block;
}

.thumbnail-credit {
  margin: 6px 2px 0;
  font-size: 11px;
  color: var(--text-dim);
  text-align: right;
}

.thumbnail-credit a { color: var(--text-dim); text-decoration: underline; }
.thumbnail-credit a:hover { color: var(--accent); }

.article p { font-size: 17px; line-height: 2; margin: 18px 0; }

.article p.lead-paragraph {
  background: var(--accent-soft);
  border-left: 4px solid var(--accent);
  border-radius: 8px;
  padding: 18px 20px;
  font-size: 16px;
  line-height: 1.9;
  margin: 0 0 32px;
}

.article h2 {
  font-size: 22px;
  margin-top: 48px;
  padding-bottom: 10px;
  border-bottom: 3px solid var(--accent);
}

.article h3 {
  font-size: 18px;
  margin-top: 32px;
  padding-left: 12px;
  border-left: 4px solid var(--accent);
}

.article strong {
  font-weight: 700;
  color: #000;
  background: #fff3b0;
  padding: 0 2px;
}

/* article_generator.pyが本文中に出力する `:::point ... :::` は
   site_builder.pyのconvert_callout_boxes()で<div class="callout-box point">に変換される。
   caution系はプロンプト側で未使用だが、将来のための土台として残す。 */
.callout-box {
  margin: 20px 0 24px;
  padding: 14px 18px;
  border-radius: 10px;
  border-left: 5px solid var(--accent);
  background: var(--accent-soft);
  font-size: 15px;
}

.callout-box.point { border-left-color: #2f6fed; background: #eaf1ff; }
.callout-box.caution { border-left-color: #e0a020; background: #fdf3e2; }

.callout-label {
  display: block;
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.05em;
  color: var(--accent);
  margin-bottom: 6px;
}

.callout-box.caution .callout-label { color: #b5790a; }

/* article_generator.py/draft_importer.py経由の本文にMarkdownの表(GFM形式)が
   含まれる場合、render_article_html()側でmarkdownライブラリのtables拡張を有効化して
   <table>に変換している。ここではそのHTML出力の見た目を整える。 */
.article table {
  width: 100%;
  display: block;
  overflow-x: auto;
  border-collapse: collapse;
  margin: 24px 0;
  font-size: 15px;
}

.article th,
.article td {
  border: 1px solid var(--border);
  padding: 10px 14px;
  text-align: left;
  white-space: nowrap;
}

.article th {
  background: var(--surface);
  font-weight: 700;
}

.toc-box {
  margin: 24px 0 36px;
  padding: 16px 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
}

.toc-box summary {
  cursor: pointer;
  font-weight: 700;
  font-size: 14px;
}

.toc-list {
  margin: 12px 0 0;
  padding-left: 20px;
  font-size: 14px;
}

.toc-list li { margin: 6px 0; }
.toc-list a { color: var(--text); }
.toc-list a:hover { color: var(--accent); }

.ad-slot {
  margin: 28px 0;
  padding: 20px;
  text-align: center;
  background: #f0f0f0;
  border: 1px dashed #ccc;
  border-radius: 8px;
  color: #999;
  font-size: 12px;
}

/* ADSENSE_CLIENT_ID/ADSENSE_SLOT_IDS設定時、実広告ユニットにはプレースホルダーの
   見た目(グレー背景・破線)を出さない */
.ad-slot-reserved { display: none; }

.ad-slot.ad-slot-live {
  background: none;
  border: none;
  padding: 0;
}

.related-articles { margin-top: 56px; }
.related-articles h2 { font-size: 18px; margin-bottom: 16px; }

/* ── フッター ── */

.site-footer {
  margin-top: 60px;
  background: var(--header-bg);
  color: rgba(245, 246, 250, 0.8);
}

.footer-inner {
  max-width: 960px;
  margin: 0 auto;
  padding: 28px 20px;
  text-align: center;
}

.footer-logo { font-weight: 700; color: #fff; margin: 0 0 10px; }
.footer-links { display: flex; justify-content: center; gap: 16px; margin-bottom: 10px; }
.footer-links a { color: rgba(245, 246, 250, 0.8); font-size: 13px; }
.footer-links a:hover { color: #fff; }
.footer-copyright { font-size: 11px; margin: 0; color: rgba(245, 246, 250, 0.5); }

/* ── レスポンシブ ── */

@media (max-width: 640px) {
  .header-inner { flex-direction: column; align-items: stretch; gap: 10px; }
  .site-nav { order: 3; }
  .site-search { width: 100%; margin-left: 0; }
  .card-grid { grid-template-columns: 1fr; }
  .article h1 { font-size: 21px; }
  .article p { font-size: 16px; }
  .article p.lead-paragraph { padding: 14px 16px; font-size: 15px; }
  .article h2 { font-size: 19px; }
  .article h3 { font-size: 16px; }
  .toc-box { padding: 12px 16px; margin: 20px 0 28px; }
  .page-inner { padding: 24px 16px 48px; }
}

/* ============ デザイントークン ============ */
:root {
  --paper: #f2f6f3;
  --grid: #d9e6df;
  --sheet: #ffffff;
  --ink: #16293c;
  --ink-dim: #55665f;
  --line: #b9ccc3;
  --lcd: #cbddb8;
  --lcd-ink: #1a2b19;
  --hi: #ffe55c;
  --seal: #c93a2e;
  --link: #1b5fa8;

  --bg: var(--paper);
  --surface: var(--sheet);
  --text: var(--ink);
  --text-dim: var(--ink-dim);
  --accent: var(--link);
  --accent-soft: #e3eef9;
  --border: var(--line);
  --header-bg: var(--ink);
  --header-text: #f2f6f3;

  --font-head: "Zen Kaku Gothic New", "Hiragino Sans", "Yu Gothic", sans-serif;
  --font-body: "BIZ UDPGothic", "Hiragino Sans", "Yu Gothic", "Meiryo", sans-serif;
  --font-lcd: "DotGothic16", "BIZ UDPGothic", monospace;
}

/* ============ 紙面(方眼ノート) ============ */
body {
  font-family: var(--font-body);
  color: var(--ink);
  line-height: 1.85;
  background-color: var(--paper);
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 24px 24px;
}

a { color: var(--link); text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { background: var(--hi); text-decoration: none; }

:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; box-shadow: 0 0 0 5px var(--hi); }

.page-inner {
  max-width: 960px;
  margin: 28px auto 56px;
  padding: 36px 44px 48px;
  background: var(--sheet);
  border: 1px solid var(--line);
  border-top: 4px solid var(--ink);
}

h1, h2, h3, .page-title { font-family: var(--font-head); color: var(--ink); }
.article h1, .page-title { font-size: 32px; font-weight: 900; line-height: 1.35; letter-spacing: 0.01em; margin: 6px 0 14px; }
.article h2 { font-size: 21px; font-weight: 700; margin: 44px 0 14px; padding: 0 0 8px; border-bottom: 2px solid var(--ink); }
.article p { font-size: 16px; line-height: 1.95; margin: 14px 0; }
.article ol, .article ul { padding-left: 1.4em; }
.article li { margin: 6px 0; }
.article-category { margin: 0 0 4px; }

.category-tag {
  padding: 2px 10px;
  border-radius: 2px;
  background: var(--ink);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-decoration: none;
}
.category-tag:hover { background: var(--ink); color: var(--hi); opacity: 1; }

.breadcrumbs { font-size: 13px; color: var(--ink-dim); margin-bottom: 18px; }
.breadcrumbs a { color: var(--ink-dim); }
.breadcrumbs a:hover { color: var(--ink); }

/* ============ ヘッダー(紙の上のロゴ + 液晶の検索窓 + シートに接続したインデックスタブ) ============ */
.site-header { max-width: 960px; margin: 26px auto 0; background: none; color: var(--ink); }
.header-top { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px 28px; padding: 0 2px 18px; }

.site-logo {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  color: var(--ink);
  text-decoration: none;
}
.site-logo:hover { background: none; color: var(--ink); }
.logo-text { display: flex; flex-direction: column; gap: 2px; line-height: 1.2; }
.logo-name { font-family: var(--font-head); font-size: 30px; font-weight: 900; letter-spacing: 0.04em; }
.logo-sub { font-size: 12.5px; color: var(--ink-dim); letter-spacing: 0.03em; }

/* 朱印 */
.seal {
  flex: 0 0 auto;
  display: inline-grid;
  place-items: center;
  width: 46px;
  height: 46px;
  background: var(--seal);
  color: #fff;
  font-family: var(--font-head);
  font-size: 28px;
  font-weight: 900;
  line-height: 1;
  border-radius: 4px;
  transform: rotate(-5deg);
  box-shadow: inset 0 0 0 2px var(--seal), inset 0 0 0 4px rgba(255, 255, 255, 0.55), 2px 3px 0 rgba(22, 41, 60, 0.18);
  transition: transform 0.15s ease;
}
.site-logo:hover .seal { transform: rotate(0deg); }

/* 検索窓(電卓の液晶) */
.site-search { position: relative; flex: 0 1 320px; width: 320px; margin-left: auto; }
.site-search input {
  width: 100%;
  height: 46px;
  padding: 0 14px 0 44px;
  font-family: var(--font-lcd);
  font-size: 17px;
  color: var(--lcd-ink);
  background-color: var(--lcd);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 20 20' fill='none' stroke='%231a2b19' stroke-width='2.2'%3E%3Ccircle cx='8.5' cy='8.5' r='5.8'/%3E%3Cpath d='M13 13l5 5' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: 14px 50%;
  border: 2px solid var(--ink);
  border-radius: 3px;
  box-shadow: inset 0 3px 0 rgba(22, 41, 60, 0.14);
  -webkit-appearance: none;
  appearance: none;
}
.site-search input::placeholder { color: rgba(26, 43, 25, 0.55); }
.site-search input:focus { outline: none; box-shadow: inset 0 3px 0 rgba(22, 41, 60, 0.14), 0 0 0 3px var(--hi); }
.site-search input::-webkit-search-cancel-button { -webkit-appearance: none; }

.search-results {
  top: calc(100% + 8px);
  left: auto;
  right: 0;
  width: 420px;
  max-width: calc(100vw - 32px);
  background: var(--sheet);
  border: 2px solid var(--ink);
  border-radius: 0;
  box-shadow: 5px 5px 0 var(--ink);
  max-height: 380px;
}
.search-result-item { padding: 10px 14px; border-bottom: 1px dotted var(--line); }
.search-result-item strong { font-family: var(--font-head); font-size: 14.5px; color: var(--ink); }
.search-result-item span { font-size: 12px; line-height: 1.6; color: var(--ink-dim); }
.search-result-item:hover, .search-result-item:focus-visible { background: var(--hi); }
.search-empty { padding: 14px; font-size: 14px; color: var(--ink-dim); }

/* カテゴリタブ: 下のシートと一体に見える手帳のインデックス */
.header-tabs { display: flex; gap: 3px; padding: 0; margin: 0; }
.header-tabs a {
  position: relative;
  flex: 1 1 auto;
  padding: 10px 6px 9px;
  text-align: center;
  font-family: var(--font-head);
  font-size: 13.5px;
  font-weight: 700;
  line-height: 1.3;
  color: var(--ink);
  background: #dbe7e0;
  border: 2px solid var(--ink);
  border-bottom: none;
  border-radius: 7px 7px 0 0;
  text-decoration: none;
  white-space: nowrap;
}
.header-tabs a:hover { background: var(--hi); color: var(--ink); }
.header-tabs a.is-active {
  background: var(--sheet);
  z-index: 2;
  margin-bottom: -4px;
  padding-bottom: 13px;
}
.header-tabs a.is-active::before {
  content: "";
  position: absolute;
  left: 8px;
  right: 8px;
  top: 5px;
  height: 4px;
  background: var(--hi);
}
.site-header + main .page-inner { margin-top: 0; }

/* ============ フッター ============ */
.site-footer { background: transparent; color: var(--ink-dim); border-top: 2px solid var(--ink); margin-top: 0; padding-top: 4px; }
.footer-inner { max-width: 960px; }
.footer-logo { font-family: var(--font-head); font-weight: 900; color: var(--ink); }
.footer-links a { color: var(--ink-dim); }
.footer-links a:hover { color: var(--ink); }

/* ============ ツール本体(計算用紙) ============ */
.tool-intro { font-size: 17px; color: var(--ink-dim); margin: 0 0 22px; line-height: 1.9; }

.tool-box {
  background: #fbfdfc;
  border: 2px solid var(--ink);
  border-radius: 0;
  padding: 24px 24px 26px;
  margin: 8px 0 30px;
  box-shadow: none;
}

.tool-fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px 22px; }
.tool-field { display: flex; flex-direction: column; gap: 5px; }
.tool-field.wide { grid-column: 1 / -1; }
.tool-field label { font-family: var(--font-head); font-size: 14px; font-weight: 700; color: var(--ink); }
.tool-field .unit { color: var(--ink-dim); font-weight: 500; }
.tool-field small { color: var(--ink-dim); font-size: 12.5px; line-height: 1.6; }

.tool-field input[type="number"],
.tool-field input[type="text"],
.tool-field input[type="date"],
.tool-field input[type="time"],
.tool-field input[type="datetime-local"],
.tool-field select,
.tool-field textarea,
.tool-box input[type="number"],
.tool-box input[type="text"],
.tool-box select,
.tool-box textarea {
  width: 100%;
  min-height: 44px;
  padding: 9px 12px;
  font-size: 17px;
  font-family: var(--font-body);
  border: 1.5px solid var(--ink);
  border-radius: 2px;
  background: #fff;
  color: var(--ink);
}
.tool-field input[type="number"], .tool-box input[type="number"] { font-variant-numeric: tabular-nums; }
.tool-field textarea, .tool-box textarea { line-height: 1.7; resize: vertical; }

.tool-field input:focus, .tool-field select:focus, .tool-field textarea:focus,
.tool-box input:focus, .tool-box select:focus, .tool-box textarea:focus {
  outline: none;
  background: #fffdf0;
  border-color: var(--ink);
  box-shadow: 0 0 0 3px var(--hi);
}

.tool-check { flex-direction: row; align-items: center; gap: 10px; min-height: 44px; }
.tool-check input { width: 22px; height: 22px; accent-color: var(--ink); }
.tool-check label { font-weight: 500; font-family: var(--font-body); }

.tool-actions { margin-top: 18px; display: flex; gap: 10px; flex-wrap: wrap; }

.tool-btn {
  min-height: 44px;
  padding: 9px 22px;
  border-radius: 2px;
  border: 2px solid var(--ink);
  background: var(--ink);
  color: #fff;
  font-family: var(--font-head);
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.tool-btn:hover { background: #0e1b29; color: var(--hi); opacity: 1; }
.tool-btn:active { transform: translateY(1px); }
.tool-btn.sub { background: #fff; color: var(--ink); }
.tool-btn.sub:hover { background: var(--hi); color: var(--ink); }

/* ============ 結果(電卓の液晶 + レシート) ============ */
.tool-result { margin-top: 22px; }
.tool-result:empty { display: none; }
.tool-error { color: #a4261c; font-size: 15px; font-weight: 700; padding: 12px 14px; border: 1.5px solid var(--seal); background: #fdf1ef; }
.tool-error p { margin: 0; }

.tool-lcd {
  background: var(--lcd);
  color: var(--lcd-ink);
  border: 2px solid var(--ink);
  box-shadow: inset 0 3px 0 rgba(0, 0, 0, 0.12), inset 0 0 0 4px rgba(255, 255, 255, 0.18);
  padding: 14px 20px 16px;
  margin-bottom: 14px;
  font-family: var(--font-lcd);
}
.tool-lcd-label { display: block; font-size: 14px; opacity: 0.9; margin-bottom: 2px; }
.tool-lcd-value { display: block; font-size: 30px; line-height: 1.35; word-break: break-all; text-align: right; font-variant-numeric: tabular-nums; }

.article .tool-table, .tool-table { display: table; width: 100%; overflow: visible; margin: 0; border-collapse: collapse; font-size: 15px; }
.tool-table th, .tool-table td { white-space: normal; padding: 9px 4px; border: none; border-bottom: 1px dotted var(--line); text-align: left; vertical-align: top; background: none; }
.tool-table th { width: 46%; font-weight: 500; color: var(--ink-dim); }
.tool-table td { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; word-break: break-all; }
.tool-table tr:last-child th, .tool-table tr:last-child td { border-bottom: 2px solid var(--ink); }

.tool-text {
  width: 100%;
  font-family: "BIZ UDPGothic", "Consolas", "Menlo", monospace;
  font-size: 15px;
  line-height: 1.7;
  margin-bottom: 10px;
  padding: 10px 12px;
  border: 1.5px solid var(--ink);
  border-radius: 2px;
  background: #fff;
}
.tool-note { font-size: 13px; color: var(--ink-dim); margin: 12px 0 0; line-height: 1.7; }
.tool-html { font-size: 15px; line-height: 1.8; }
.tool-html .diff-add { background: #d9f7de; }
.tool-html .diff-del { background: #fde0e0; }
.tool-swatch { border-radius: 2px; border: 1.5px solid var(--ink); }

/* タイマー等の大きな表示も液晶に */
.tool-big {
  font-family: var(--font-lcd);
  background: var(--lcd);
  color: var(--lcd-ink);
  border: 2px solid var(--ink);
  box-shadow: inset 0 3px 0 rgba(0, 0, 0, 0.12);
  padding: 10px 14px;
  margin: 10px auto 16px;
  max-width: 520px;
  font-size: 56px;
  line-height: 1.3;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

/* ============ 説明部分(使い方・解説・よくある質問) ============ */
.tool-page ol { list-style: none; counter-reset: step; padding: 0; margin: 12px 0; }
.tool-page ol li { counter-increment: step; position: relative; padding: 4px 0 4px 40px; margin: 8px 0; }
.tool-page ol li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 3px;
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  background: var(--ink);
  color: #fff;
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 14px;
  border-radius: 2px;
}

.tool-guide ul { padding-left: 1.2em; }
.tool-guide li::marker { color: var(--ink); }

.tool-faq dt { font-family: var(--font-head); font-weight: 700; margin-top: 20px; padding-left: 14px; border-left: 4px solid var(--hi); }
.tool-faq dd { margin: 6px 0 0 18px; }

/* ============ 一覧(カードではなく罫線を共有する目録表) ============ */
.tool-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 0;
  margin-top: 12px;
  border-top: 2px solid var(--ink);
  border-left: 1px solid var(--line);
}
.tool-card {
  display: block;
  padding: 14px 16px 16px;
  background: #fff;
  border: none;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  color: var(--ink);
  text-decoration: none;
  box-shadow: none;
  transition: none;
}
.tool-card:hover { background: var(--hi); transform: none; box-shadow: none; }
.tool-card strong { display: block; font-family: var(--font-head); font-size: 15.5px; line-height: 1.5; color: var(--ink); margin-bottom: 4px; }
.tool-card span { font-size: 12.5px; line-height: 1.65; color: var(--ink-dim); display: block; }
.tool-card:hover span { color: var(--ink); }

.home-hero { padding: 6px 0 10px; }
.home-hero h1 { margin: 0 0 12px; font-size: 38px; }
.home-lead { font-size: 18px; line-height: 1.9; color: var(--ink-dim); max-width: 36em; margin: 0 0 18px; }
.home-links { display: flex; gap: 10px; flex-wrap: wrap; margin: 0; }
.home-links .tool-btn { text-decoration: none; display: inline-flex; align-items: center; }
.home-links .tool-btn:hover { background: var(--hi); color: var(--ink); }
.home-cats { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 0; border-top: 1px solid var(--line); border-left: 1px solid var(--line); margin-top: 14px; }
.home-cat { display: block; padding: 16px 18px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); background: #fbfdfc; text-decoration: none; color: var(--ink); }
.home-cat:hover { background: var(--hi); }
.home-cat strong { display: block; font-family: var(--font-head); font-size: 17px; margin-bottom: 4px; }
.home-cat span { display: block; font-size: 13px; line-height: 1.7; color: var(--ink-dim); }
.home-cat em { display: block; margin-top: 6px; font-style: normal; font-size: 12.5px; font-weight: 700; color: var(--ink); }
.category-intro { margin-top: 40px; }
.category-intro h2 { margin-top: 0; }
.all-tools { list-style: none; padding: 0; margin: 8px 0 0; }
.all-tools li { padding: 8px 0; border-bottom: 1px dotted var(--line); font-size: 15px; line-height: 1.7; }
.all-tools a { font-family: var(--font-head); font-weight: 700; }
.tool-example, .tool-know, .tool-pitfalls { margin-top: 0; }
.example-table th { width: 55%; }
.category-lead { color: var(--ink-dim); margin: 0 0 20px; font-size: 15px; }
.related-tools { margin-top: 44px; }
.related-tools h2 { font-size: 19px; border: none; margin: 0 0 6px; padding: 0; }

@media (max-width: 1000px) {
  .site-header { padding: 0 12px; }
  .page-inner { margin-left: 12px; margin-right: 12px; }
  .header-tabs { overflow-x: auto; scrollbar-width: none; padding-top: 4px; }
  .header-tabs::-webkit-scrollbar { display: none; }
  .header-tabs a { padding-left: 14px; padding-right: 14px; }
  .header-tabs a.is-active { margin-bottom: 0; padding-bottom: 9px; }
}

/* ============ スマートフォン ============ */
@media (max-width: 720px) {
  .page-inner { margin: 0; padding: 22px 16px 36px; }
  .home-hero h1 { font-size: 30px; }
  .home-lead { font-size: 16px; }
  .article h1, .page-title { font-size: 26px; }
  .tool-box { padding: 18px 14px 20px; }
  .site-header { margin-top: 16px; padding: 0 12px; }
  .header-top { flex-wrap: wrap; padding-bottom: 14px; }
  .logo-name { font-size: 24px; }
  .seal { width: 40px; height: 40px; font-size: 24px; }
  .site-search { flex: 1 1 100%; width: 100%; }
  .search-results { left: 0; right: 0; width: auto; }
  .tool-lcd-value { font-size: 24px; }
  .tool-big { font-size: 42px; }
  .tool-table th { width: 50%; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}
