@charset "UTF-8";
/*
 * 全国安全データマップ 共通スタイル。
 * 承認済みデザインカンプ docs/anzen/sagi-stats-mockup.html のトークンをそのまま使う。
 *
 * 読者に高齢者を含むため、次の3点は変えないこと:
 *   - 基本フォントサイズ 17px 以上
 *   - 被害・警告に使う色は深紅(--alert)だけ。装飾には使わない
 *   - 横スクロールやタップ前提の操作を要求しない
 */

:root {
  --ink: #1B2A41;        /* 本文: 濃紺（公的・信頼） */
  --ink-soft: #5A6B80;
  --paper: #FFFFFF;
  --paper-dim: #F3F5F8;
  --alert: #B0342C;      /* 被害データ: 深紅 */
  --alert-soft: #F6E7E5;
  --accent2: #C07A2D;    /* 第2系列: 琥珀 */
  --accent3: #8A8F98;
  --line: #D8DEE6;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: "Hiragino Kaku Gothic ProN", "Yu Gothic", "Noto Sans JP", sans-serif;
  background: var(--paper-dim);
  color: var(--ink);
  font-size: 17px;
  line-height: 1.8;
  -webkit-text-size-adjust: 100%;
}

.wrap {
  max-width: 680px;
  margin: 0 auto;
  background: var(--paper);
  min-height: 100vh;
}

a { color: inherit; }

/* パンくず ------------------------------------------------------- */
.crumbs {
  font-size: 12px;
  color: var(--ink-soft);
  padding: 10px 20px;
  border-bottom: 1px solid var(--line);
  overflow-wrap: anywhere;
}
.crumbs a { color: var(--ink-soft); }
.crumbs span { margin: 0 4px; }

/* ヘッダー ------------------------------------------------------- */
header { padding: 26px 20px 16px; border-bottom: 3px solid var(--ink); }
.eyebrow { font-size: 12px; letter-spacing: .18em; color: var(--ink-soft); margin-bottom: 6px; }
h1 { font-size: 24px; line-height: 1.4; font-weight: 700; }
.lead { font-size: 15px; color: var(--ink-soft); margin-top: 10px; }
.meta { font-size: 12px; color: var(--ink-soft); margin-top: 12px; display: flex; gap: 8px; flex-wrap: wrap; }
.meta span { background: var(--paper-dim); padding: 3px 10px; border-radius: 3px; }

/* セクション ----------------------------------------------------- */
section { padding: 24px 20px; border-bottom: 1px solid var(--line); }
h2 { font-size: 17px; font-weight: 700; margin-bottom: 14px; display: flex; align-items: center; gap: 8px; }
h2::before { content: ""; width: 5px; height: 18px; background: var(--ink); display: inline-block; flex: none; }
.note { font-size: 13px; color: var(--ink-soft); margin-top: 12px; }
.note + .note { margin-top: 6px; }

/* 今月のポイント = シグネチャー要素 -------------------------------- */
.point {
  background: var(--alert-soft);
  border-left: 5px solid var(--alert);
  padding: 18px 16px;
  border-radius: 0 8px 8px 0;
}
.point .label { font-size: 13px; font-weight: 700; color: var(--alert); letter-spacing: .1em; margin-bottom: 8px; }
.point p { font-size: 17px; line-height: 2; }
.point p + p { margin-top: 4px; }
.point b { font-size: 21px; color: var(--alert); font-weight: 700; }

/* もとにしている資料（ページ冒頭） ---------------------------------- */
/* **出典はグラフより先に出す。** 末尾に置くと、数字だけ見て帰る人に届かない。
   深紅は被害データ専用なので、ここは濃紺の帯にする（警告ではなく出所の表示） */
.origin {
  margin-top: 16px;
  background: var(--paper-dim);
  border-left: 5px solid var(--ink);
  border-radius: 0 8px 8px 0;
  padding: 14px 16px;
}
.origin-label {
  font-size: 12px; font-weight: 700; letter-spacing: .1em;
  color: var(--ink-soft); margin-bottom: 8px;
}
.origin ol { list-style: none; counter-reset: org; }
.origin li {
  counter-increment: org; position: relative; padding-left: 1.6em;
  font-size: 14px; line-height: 1.7;
}
.origin li + li { margin-top: 8px; }
.origin li::before {
  content: counter(org) ".";
  position: absolute; left: 0; color: var(--ink-soft); font-weight: 700;
}
.origin .origin-sub {
  display: block; font-size: 12px; color: var(--ink-soft); line-height: 1.6;
}
.origin-note {
  margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line);
  font-size: 13px; line-height: 1.8; color: var(--ink);
}

/* 主要数値カード -------------------------------------------------- */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.card { background: var(--paper-dim); border-radius: 8px; padding: 14px; }
.card .k { font-size: 13px; color: var(--ink-soft); }
.card .v { font-size: 28px; font-weight: 700; line-height: 1.3; font-variant-numeric: tabular-nums; }
.card .v small { font-size: 13px; font-weight: 400; }
.card .d { font-size: 13px; margin-top: 2px; }
.up { color: var(--alert); }
.down { color: var(--ink-soft); }
.flat { color: var(--ink-soft); }

/* グラフ --------------------------------------------------------- */
.chart { margin-bottom: 6px; }
.chart svg { display: block; width: 100%; height: auto; }
.chart-title { font-size: 14px; font-weight: 700; margin-bottom: 6px; }
.chart + .chart { margin-top: 22px; }

/* 図表の一式（図 + 直下の注記 + 数値テーブル） ---------------------- */
/* **注記とテーブルは figcaption の中に入れる。** 図の直下に注記が来る順序を
   マークアップで固定したいため。「分母が違う」等の但し書きが図から離れると、
   グラフだけ見て帰る人に届かない。テーブルは畳んであるだけでDOMには常にある */
.chart-figure { margin: 0 0 4px; }
.chart-figure + .chart-figure { margin-top: 26px; }
.chart-figure > svg { display: block; width: 100%; height: auto; }
.chart-figure figcaption { display: block; }
/* figcaption 内の最初の注記だけ、図との間を少し空ける */
.chart-figure figcaption > .note:first-child { margin-top: 14px; }

/* 図の数値テーブル。行が多いので詰める */
.chart-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.chart-table th, .chart-table td { padding: 6px 4px; border-bottom: 1px solid var(--line); }
.chart-table thead th {
  font-size: 12px; font-weight: 700; color: var(--ink-soft); text-align: right;
  border-bottom: 2px solid var(--ink); white-space: nowrap;
}
.chart-table thead th:first-child { text-align: left; }
.chart-table tbody th, .chart-table tfoot th { text-align: left; font-weight: 400; white-space: nowrap; }
.chart-table tfoot th, .chart-table tfoot td { font-weight: 700; border-bottom: none; }
.chart-table td.n { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.chart-table .g { display: inline-block; margin-left: 6px; font-size: 11px; color: var(--ink-soft); }

/* 目で見えないが読み上げ・検索には残す。表のcaption等に使う */
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* 図の前に読ませる注意書き。**図より先に置く**（後ろだと読まれない） */
.readfirst { list-style: none; counter-reset: rf; }
.readfirst li {
  counter-increment: rf; position: relative; font-size: 15px; line-height: 1.8;
  padding: 12px 0 12px 2.4em; border-bottom: 1px solid var(--line);
}
.readfirst li:last-child { border-bottom: none; }
.readfirst li::before {
  content: counter(rf); position: absolute; left: 0; top: 13px;
  width: 1.7em; height: 1.7em; border-radius: 50%;
  background: var(--ink); color: #fff; font-size: 12px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}

/* 全体に占める割合の1本バー ---------------------------------------- */
.ratio .bar-bg { height: 22px; }
.ratio-label { font-size: 14px; margin-top: 6px; font-variant-numeric: tabular-nums; }
.ratio-label b { font-size: 17px; }

/* 制度の要件表（変更前 / 変更後） ----------------------------------- */
.spec-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.spec-table th, .spec-table td {
  padding: 9px 8px; border-bottom: 1px solid var(--line);
  text-align: left; vertical-align: top; line-height: 1.7;
}
.spec-table thead th {
  font-size: 12px; font-weight: 700; color: var(--ink-soft); border-bottom: 2px solid var(--ink);
}
.spec-table tbody th { font-weight: 700; white-space: nowrap; }

/* 手口別の横棒（円グラフは使わない＝高齢読者に読み取りにくいため） ---- */
.bar-row { margin-bottom: 16px; }
.bar-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; font-size: 15px; margin-bottom: 5px; }
.bar-head .name { font-weight: 700; }
.bar-head .pct { color: var(--ink-soft); font-size: 14px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.bar-bg { height: 18px; background: var(--paper-dim); border-radius: 4px; overflow: hidden; }
.bar { height: 100%; border-radius: 4px; min-width: 2px; }
.bar-sub { font-size: 13px; color: var(--ink-soft); margin-top: 4px; font-variant-numeric: tabular-nums; }

/* 用語・手口の説明 ------------------------------------------------ */
.defs { margin-top: 18px; border-top: 1px solid var(--line); padding-top: 14px; }
.defs dt { font-size: 14px; font-weight: 700; margin-top: 10px; }
.defs dd { font-size: 14px; color: var(--ink-soft); line-height: 1.7; }

/* 身を守るために ------------------------------------------------- */
.guard { background: var(--ink); color: #fff; padding: 26px 20px; border-bottom: none; }
.guard h2 { color: #fff; }
.guard h2::before { background: #fff; }
.guard li { list-style: none; padding-left: 1.4em; position: relative; margin-bottom: 12px; font-size: 16px; }
.guard li::before { content: "○"; position: absolute; left: 0; color: #F0C36D; }
.guard a { color: #fff; }
.tel { background: #fff; color: var(--ink); border-radius: 8px; padding: 14px 16px; text-align: center; margin-top: 16px; }
.tel .t { font-size: 13px; color: var(--ink-soft); }
.tel .n { font-size: 32px; font-weight: 700; letter-spacing: .05em; }
/* .guard a の白を打ち消す。ここは白地なので紺に戻さないと番号が読めなくなる */
.tel a, .guard .tel a { color: var(--ink); text-decoration: none; }
.guard .note { color: #C9D2DE; }

/* ハブ ----------------------------------------------------------- */
.tiles { display: grid; gap: 12px; }
.tile { display: block; border: 1px solid var(--line); border-radius: 8px; padding: 16px; text-decoration: none; }
.tile:hover { background: var(--paper-dim); }
.tile .t { display: block; font-size: 17px; font-weight: 700; }
.tile .d { display: block; font-size: 14px; color: var(--ink-soft); margin-top: 4px; line-height: 1.7; }
.tile.soon { opacity: .6; }

/* 関連リンク ------------------------------------------------------ */
.links { list-style: none; }
.links li { padding-left: 1.1em; position: relative; margin-bottom: 10px; font-size: 15px; line-height: 1.7; }
.links li::before { content: "→"; position: absolute; left: 0; color: var(--accent2); }

/* 罪種の一覧表 ---------------------------------------------------- */
.rank { width: 100%; border-collapse: collapse; font-size: 15px; }
.rank th {
  font-size: 13px; font-weight: 700; color: var(--ink-soft); text-align: left;
  padding: 6px 4px; border-bottom: 2px solid var(--ink);
}
.rank th:not(:first-child) { text-align: right; }
.rank td { padding: 10px 4px; border-bottom: 1px solid var(--line); vertical-align: baseline; }
.rank td.n { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.rank td .g { display: block; font-size: 12px; color: var(--ink-soft); }

/* 都道府県ナビ --------------------------------------------------- */
.prefnav { font-size: 15px; line-height: 2.1; margin-bottom: 10px; }
.prefnav .g {
  display: inline-block; min-width: 6.5em; font-size: 13px; font-weight: 700;
  color: var(--ink-soft); background: var(--paper-dim);
  padding: 1px 8px; border-radius: 3px; margin-right: 6px;
}
.prefnav a { margin-right: 12px; white-space: nowrap; }
.prefnav .current { margin-right: 12px; white-space: nowrap; font-weight: 700; color: var(--ink-soft); }

/* フッター ------------------------------------------------------- */
footer { padding: 20px; font-size: 12px; color: var(--ink-soft); line-height: 1.9; }
footer p + p { margin-top: 6px; }

/* 塗り分け地図 --------------------------------------------------- */
.choropleth { margin: 0 0 6px; }
.choropleth svg { display: block; width: 100%; height: auto; background: var(--paper-dim); border-radius: 8px; }
.choropleth path { transition: none; }
/* リンクの有無にかかわらず、カーソルを乗せた区画が分かるようにする。
   町丁の地図はリンクを張っていないので a:hover だけでは何も起きない */
.choropleth path:hover,
.choropleth a:hover path { stroke: var(--ink); stroke-width: 2.5; }
.choropleth path { cursor: default; }
.choropleth a path { cursor: pointer; }
.choropleth figcaption { margin-top: 12px; }
.legend-title { font-size: 13px; font-weight: 700; color: var(--ink-soft); margin-bottom: 6px; }
.legend { list-style: none; display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 13px; font-variant-numeric: tabular-nums; }
.legend li { display: flex; align-items: center; gap: 5px; }
.legend .sw { width: 15px; height: 15px; border-radius: 3px; border: 1px solid var(--line); flex: none; }

/* 区市町村の一覧表は行が多いので詰める */
.arealist td { padding: 7px 4px; }

/* 町丁の一覧。**名前順**に並べる（件数順にすると順位表になるため） */
.townlist { font-size: 14px; line-height: 2; margin-top: 14px; }
.townlist span { display: inline-block; margin-right: 14px; white-space: nowrap; }
.townlist b { font-variant-numeric: tabular-nums; }

/* 地図の操作 --------------------------------------------------- */
/* JSが動かないときは操作UIを出さない（押しても何も起きないボタンは出さない） */
.mapctl, .maponly-js { display: none; }
.choropleth.is-interactive .mapctl { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.choropleth.is-interactive .maponly-js { display: block; }
.mapctl button {
  font: inherit; font-size: 15px; line-height: 1; min-width: 40px; min-height: 40px;
  padding: 0 12px; border: 1px solid var(--line); border-radius: 6px;
  background: var(--paper); color: var(--ink); cursor: pointer;
}
.mapctl button:hover { background: var(--paper-dim); }
.mapctl .hint { font-size: 12px; color: var(--ink-soft); margin-left: 4px; }
.choropleth.is-interactive svg { touch-action: none; cursor: grab; }
.choropleth.is-interactive.is-zoomed svg { cursor: move; }

/* 比較ページ ----------------------------------------------------- */
.compare-form .field { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.compare-form label { font-size: 14px; color: var(--ink-soft); min-width: 4.5em; }
.compare-form select {
  font: inherit; font-size: 16px; flex: 1; min-height: 44px;
  padding: 6px 10px; border: 1px solid var(--line); border-radius: 6px; background: var(--paper); color: var(--ink);
}
.compare-form button {
  font: inherit; font-size: 16px; font-weight: 700; min-height: 44px; padding: 0 24px;
  border: none; border-radius: 6px; background: var(--ink); color: #fff; cursor: pointer;
}
.compare-form button:hover { background: #2b3d57; }
/* 3件並ぶと狭い画面では収まらないので、表だけ横に送れるようにする */
.tablewrap { overflow-x: auto; }
.compare th[scope="row"] { font-size: 14px; color: var(--ink-soft); text-align: left; white-space: nowrap; border-bottom: 1px solid var(--line); }
.compare thead th { text-align: right; white-space: nowrap; }
.compare thead th:first-child { text-align: left; }

/* 昼夜間人口の対比 ------------------------------------------------ */
.daynight { margin-bottom: 4px; }
.dn-title { font-size: 14px; font-weight: 700; margin-bottom: 8px; }
.daynight .dn-title:not(:first-child) { margin-top: 20px; }
.daynight .bar-row { margin-bottom: 12px; }

/* 長い一覧は畳んでおく（JSを使わないネイティブのdetails） -------------- */
.longlist { margin-top: 14px; }
.longlist > summary {
  cursor: pointer; font-size: 15px; font-weight: 700; color: var(--ink);
  padding: 12px 14px; background: var(--paper-dim); border-radius: 6px;
  list-style: none; display: flex; align-items: center; gap: 8px;
}
.longlist > summary::-webkit-details-marker { display: none; }
.longlist > summary::before { content: "▶"; font-size: 11px; color: var(--ink-soft); }
.longlist[open] > summary::before { content: "▼"; }
.longlist > summary:hover { background: #E9EDF3; }
.longlist[open] > summary { margin-bottom: 12px; }

/* 目次 ----------------------------------------------------------- */
.toc { padding: 18px 20px; border-bottom: 1px solid var(--line); background: var(--paper-dim); }
.toc-title { font-size: 13px; font-weight: 700; color: var(--ink-soft); margin-bottom: 8px; }
.toc ol { list-style: none; counter-reset: toc; display: flex; flex-wrap: wrap; gap: 6px 10px; }
.toc li { counter-increment: toc; }
.toc a {
  display: inline-block; font-size: 14px; line-height: 1.5;
  padding: 6px 12px; background: var(--paper); border: 1px solid var(--line);
  border-radius: 999px; text-decoration: none;
}
.toc a:hover { background: var(--ink); color: #fff; border-color: var(--ink); }
/* 目次から飛んだとき、見出しが画面の一番上に貼り付かないようにする */
h2[id] { scroll-margin-top: 12px; }

/* 手口ごとの増減（中央から左右に伸びる棒） ------------------------ */
/* 「何が増えたか」は棒の向きで一目で分かるようにする。増加は深紅(--alert)、
   減少は紺。左右のどちらに伸びるかが情報なので、色は補助にとどめる。 */
.diverge { margin-top: 16px; }
.d-row { margin-bottom: 14px; }
.d-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; font-size: 15px; margin-bottom: 5px; }
.d-head .name { font-weight: 700; }
.d-head .val { font-size: 14px; font-weight: 700; white-space: nowrap; font-variant-numeric: tabular-nums; }
.d-track {
  position: relative; height: 16px; background: var(--paper-dim); border-radius: 4px;
}
/* 中央＝前年同期。ここが基準線であることを見せる */
.d-track::before {
  content: ""; position: absolute; left: 50%; top: -3px; bottom: -3px;
  width: 1px; background: var(--ink-soft);
}
.d-bar { position: absolute; top: 0; height: 100%; min-width: 2px; }
.d-bar.up   { background: var(--alert); border-radius: 0 4px 4px 0; }
.d-bar.down { background: var(--ink);   border-radius: 4px 0 0 4px; }
.d-sub { font-size: 13px; color: var(--ink-soft); margin-top: 4px; font-variant-numeric: tabular-nums; }

/* 手口ごとのスパークライン ---------------------------------------- */
/* 13枚並ぶので2列。1列だと縦に伸びすぎて、結局どれが増えたのか分からなくなる */
.sparks { margin-top: 16px; display: grid; grid-template-columns: 1fr 1fr; gap: 18px 14px; align-content: start; }
.spark-card { min-width: 0; }
.s-name { font-size: 14px; font-weight: 700; line-height: 1.4; }
.spark { display: block; width: 100%; height: auto; margin: 6px 0 4px; }
.s-sub { font-size: 12px; color: var(--ink-soft); line-height: 1.5; font-variant-numeric: tabular-nums; }
.s-sub + .s-sub { margin-top: 2px; }
/* 集計開始年は補足なので、その年の件数より弱く見せる */
.s-meta { margin-top: 4px; font-size: 11px; }
@media (min-width: 700px) {
  .sparks { grid-template-columns: repeat(3, 1fr); }
}
