/* ===== トークン ===== */
:root {
  --bg: #ffffff;
  --bg-sub: #f6f7f9;
  --text: #1a1d21;
  --text-mute: #5c6670;
  --border: #e2e6ea;
  --accent: #1f6feb;
  --accent-dark: #1a5fd0;
  --cta: #e8590c;
  --cta-dark: #d24f06;
  --warn-bg: #fff8e6;
  --warn-border: #f0c36d;
  --radius: 8px;
  --wrap: 720px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #14171a;
    --bg-sub: #1c2126;
    --text: #e7ebef;
    --text-mute: #9aa4ae;
    --border: #2a3138;
    --accent: #58a6ff;
    --accent-dark: #79b8ff;
    --warn-bg: #2b2415;
    --warn-border: #6b5620;
  }
}

/* ===== ベース（モバイルファースト） ===== */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, "Hiragino Sans", "Noto Sans JP", sans-serif;
  font-size: 16px;
  line-height: 1.85;
}
img { max-width: 100%; height: auto; }
a { color: var(--accent); }
.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 16px; }

/* ===== ヘッダー / フッター ===== */
.site-header {
  border-bottom: 1px solid var(--border);
  background: var(--bg);
  position: sticky; top: 0; z-index: 10;
}
.site-header .wrap { display: flex; align-items: center; gap: 16px; height: 64px; }
.site-logo { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); }
.logo-mark { width: 44px; height: 44px; display: block; flex: none; }
.logo-tagline { font-size: 15px; font-weight: 700; line-height: 1.3; letter-spacing: .02em; color: var(--text); }
.site-nav { margin-left: auto; display: flex; gap: 4px; font-size: 14px; }
.site-nav a {
  color: var(--text-mute); text-decoration: none;
  padding: 6px 10px; border-radius: 999px;
}
.site-nav a:hover { color: var(--accent); background: var(--bg-sub); }
.site-nav a { white-space: nowrap; }
@media (max-width: 559px) { /* スマホは2段：1段目にロゴとコピー、2段目にメニュー */
  .site-header { position: static; }
  .site-header .wrap { flex-wrap: wrap; height: auto; row-gap: 6px; padding-top: 10px; padding-bottom: 4px; }
  .site-nav {
    margin-left: 0; width: 100%; justify-content: space-around;
    border-top: 1px solid var(--border); padding-top: 4px; font-size: 13px;
  }
}

.site-footer {
  margin-top: 56px; padding: 28px 0;
  border-top: 1px solid var(--border);
  background: var(--bg-sub);
  font-size: 13px; color: var(--text-mute);
}
.site-footer nav { display: flex; flex-wrap: wrap; gap: 14px; margin-bottom: 12px; }
.site-footer a { color: var(--text-mute); }

/* ===== パンくず ===== */
.breadcrumb { font-size: 12px; color: var(--text-mute); padding: 14px 0 0; }
.breadcrumb ol { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; }
.breadcrumb li::after { content: "›"; margin-left: 6px; opacity: .5; }
.breadcrumb li:last-child::after { content: ""; }

/* ===== PR表記（ファーストビュー内・ステマ規制対応） ===== */
.pr-label {
  display: block;
  margin: 12px 0 0;
  padding: 8px 12px;
  background: var(--warn-bg);
  border: 1px solid var(--warn-border);
  border-radius: var(--radius);
  font-size: 13px;
  line-height: 1.6;
  color: var(--text);
}
.pr-label strong { font-weight: 700; }

/* ===== 本文 ===== */
article h1 { font-size: 26px; line-height: 1.45; margin: 14px 0 8px; letter-spacing: -.01em; }
article .meta { font-size: 13px; color: var(--text-mute); margin: 0 0 20px; }
article h2 {
  font-size: 21px; margin: 44px 0 14px; padding-bottom: 8px;
  border-bottom: 2px solid var(--border);
}
article h3 { font-size: 17px; margin: 30px 0 10px; }
article p { margin: 0 0 18px; }
article ul, article ol { margin: 0 0 18px; padding-left: 1.4em; }
article li { margin-bottom: 6px; }

.lead {
  background: var(--bg-sub);
  border-left: 3px solid var(--accent);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 16px;
  margin: 0 0 26px;
}
.lead p:last-child { margin-bottom: 0; }

/* ===== 目次 ===== */
.toc {
  background: var(--bg-sub);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  margin: 0 0 30px;
  font-size: 14px;
}
.toc-title { font-weight: 700; font-size: 15px; margin-bottom: 8px; }
.toc ol { margin: 0; padding-left: 1.3em; }
.toc ol ol { padding-left: 1.1em; margin-top: 4px; }
.toc li { margin-bottom: 4px; }
.toc a { color: var(--text); text-decoration: none; }
.toc a:hover { color: var(--accent); text-decoration: underline; }

/* ===== 表（横スクロール必須） ===== */
.table-scroll { overflow-x: auto; margin: 0 0 20px; -webkit-overflow-scrolling: touch; }
table { border-collapse: collapse; width: 100%; min-width: 520px; font-size: 14px; }
th, td { border: 1px solid var(--border); padding: 9px 11px; text-align: left; vertical-align: top; }
th { background: var(--bg-sub); font-weight: 700; white-space: nowrap; }
/* 2列程度の情報表は横スクロールさせず画面幅に合わせる */
.table-fit { min-width: 0; margin: 0 0 20px; }
.table-fit th:first-child { width: 6em; }
.table-fit td { overflow-wrap: anywhere; }
/* 横スクロールする表は1列目（社名）を固定して、今どの行かを見失わないようにする */
.table-scroll th:first-child, .table-scroll td:first-child {
  position: sticky; left: 0; z-index: 1;
  background: var(--bg); box-shadow: inset -1px 0 0 var(--border);
}
.table-scroll th:first-child { background: var(--bg-sub); }
.scroll-hint { display: none; margin: 0 0 6px; font-size: 12px; color: var(--text-mute); }
.scroll-hint.is-active { display: block; }
caption { caption-side: bottom; font-size: 12px; color: var(--text-mute); padding-top: 8px; text-align: left; }

/* ===== CTA ===== */
.cta { margin: 26px 0; text-align: center; }
.cta-btn {
  display: block; width: 100%; padding: 15px 20px;
  background: var(--cta); color: #fff;
  border-radius: var(--radius);
  font-size: 16px; font-weight: 700; text-decoration: none;
  min-height: 48px; /* タップ領域 */
}
.cta-btn:hover { background: var(--cta-dark); }
.cta-note { display: block; margin-top: 8px; font-size: 12.5px; color: var(--text-mute); }

/* ===== 注意ブロック ===== */
.callout {
  border: 1px solid var(--border);
  border-left: 3px solid var(--cta);
  border-radius: 0 var(--radius) var(--radius) 0;
  background: var(--bg-sub);
  padding: 14px 16px;
  margin: 0 0 22px;
}
.callout p:last-child, .callout ul:last-child { margin-bottom: 0; }
.callout-title { font-weight: 700; margin-bottom: 6px; }

/* ===== カード（トップ・一覧） ===== */
.card-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 14px; }
.card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  background: var(--bg);
}
.card a { text-decoration: none; color: var(--text); font-weight: 700; font-size: 16px; line-height: 1.5; }
.card a:hover { color: var(--accent); }
.card p { margin: 6px 0 0; font-size: 14px; color: var(--text-mute); }
.card .tag {
  display: inline-block; font-size: 11px; font-weight: 700;
  color: var(--accent); border: 1px solid var(--accent);
  border-radius: 4px; padding: 1px 6px; margin-bottom: 8px;
}

/* ===== 関連リンク ===== */
.related { border-top: 1px solid var(--border); margin-top: 40px; padding-top: 24px; }
.related h2 { border: 0; font-size: 18px; margin-top: 0; }

@media (min-width: 768px) {
  body { font-size: 16.5px; }
  article h1 { font-size: 31px; }
  article h2 { font-size: 23px; }
  .cta-btn { display: inline-block; width: auto; min-width: 340px; }
  .card-list { grid-template-columns: 1fr 1fr; }
}

/* ===== ページTOPへ戻るボタン ===== */
.to-top {
  position: fixed; z-index: 20;
  right: 16px; bottom: calc(16px + env(safe-area-inset-bottom));
  width: 52px; height: 52px; border: 0; border-radius: 50%;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px;
  background: var(--accent); color: #fff; cursor: pointer;
  font: 700 10px/1 system-ui, sans-serif; letter-spacing: .06em;
  box-shadow: 0 4px 14px rgba(0,0,0,.22);
  opacity: 0; pointer-events: none; transform: translateY(10px);
  transition: opacity .2s, transform .2s;
}
.to-top.is-visible { opacity: 1; pointer-events: auto; transform: none; }
.to-top:hover { background: var(--accent-dark); }
.to-top:focus-visible { outline: 3px solid var(--text); outline-offset: 2px; }
@media (min-width: 768px) { .to-top { right: 24px; bottom: 24px; } }
