/* せたがや 政務活動費まる見え
   デザインの出どころ（参考サイトから抜き出した要素）
   - circusAGENT 求人10万件突破特設サイト: タイル型の「数字で見る」、巨大な数字+小さな単位、追従するセクション名
   - Fukuoka Facts: 「問いかけ + 正式な統計名」の二段見出し、項目ごとの色タグ、更新日と出典の明記
   - マネックス証券 投資がはじめての方へ: 話し言葉のコピー、1色+黒の線画、吹き出し
*/

:root {
  color-scheme: light;
  --plane: #f4f0e6;
  --surface: #fcfcfb;
  --ink: #0b0b0b;
  --text: #0b0b0b;
  --text-2: #52514e;
  --muted: #7a7872;
  --hair: #e1e0d9;
  --axis: #c3c2b7;
  --accent: #ffd84a;        /* 画面の差し色（グラフの系列色には使わない） */
  --accent-soft: #fff1b8;
  --wash: rgba(11, 11, 11, 0.05);
  --seq: #256abf;           /* 量の大小を表す1色 */
  /* 支出項目の色: 項目に固定（順位で塗り替えない）。色覚多様性の検証済みパレット */
  --c1: #2a78d6;  /* 広報広聴費 */
  --c2: #eb6834;  /* 事務費 */
  --c3: #1baf7a;  /* 人件費 */
  --c4: #eda100;  /* 調査費 */
  --c5: #e87ba4;  /* 資料購入費 */
  --c6: #008300;  /* 研究研修費 */
  --c7: #4a3aa7;  /* 資料作成費 */
  --c8: #e34948;  /* 会議費 */
  --c-other: #a8a69e; /* 要請・陳情活動費（ごく少額） */
  --c-rest: #dedcd3;  /* 使わずに返した分 */
  --good: #006300;
  --radius: 18px;
  --shadow: 4px 4px 0 var(--ink);
  --font: "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", "Yu Gothic UI", "Meiryo", system-ui, -apple-system, "Segoe UI", sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --plane: #0d0d0d;
    --surface: #1a1a19;
    --ink: #f3f1ea;
    --text: #ffffff;
    --text-2: #c3c2b7;
    --muted: #98968f;
    --hair: #2c2c2a;
    --axis: #383835;
    --accent: #ffd84a;
    --accent-soft: #4a3f12;
    --wash: rgba(255, 255, 255, 0.07);
    --seq: #3987e5;
    --c1: #3987e5; --c2: #d95926; --c3: #199e70; --c4: #c98500;
    --c5: #d55181; --c6: #008300; --c7: #9085e9; --c8: #e66767;
    --c-other: #6f6d66; --c-rest: #3a3a37;
    --good: #0ca30c;
    --shadow: 4px 4px 0 #000;
  }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--hh, 60px) + 56px); }
body {
  margin: 0; background: var(--plane); color: var(--text);
  font-family: var(--font); font-size: 16px; line-height: 1.75;
  -webkit-font-smoothing: antialiased; text-size-adjust: 100%;
}
a { color: inherit; text-underline-offset: 3px; }
button, input, select { font: inherit; color: inherit; }
h1, h2, h3, h4, p { margin: 0; }
img, svg { max-width: 100%; }
.muted { color: var(--muted); }
.num { font-feature-settings: "palt"; letter-spacing: -0.01em; }
.tnum { font-variant-numeric: tabular-nums; }
.skip { position: absolute; left: -999px; top: 0; background: var(--ink); color: var(--surface); padding: 8px 14px; z-index: 100; }
.skip:focus { left: 8px; top: 8px; }
:focus-visible { outline: 3px solid var(--c1); outline-offset: 2px; border-radius: 6px; }
.stroke-ink { stroke: var(--ink); stroke-width: 2; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.fill-surface { fill: var(--surface); }
.fill-accent { fill: var(--accent); }
.loading { padding: 80px 16px; text-align: center; color: var(--muted); }

/* ---------- ヘッダー ---------- */
.site-header {
  position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 12px;
  padding: 10px clamp(16px, 4vw, 40px); background: color-mix(in srgb, var(--plane) 88%, transparent);
  backdrop-filter: blur(10px); border-bottom: 1.5px solid var(--ink);
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; flex: none; }
.brand-mark { width: 38px; height: 38px; }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-small { font-size: 11px; font-weight: 700; letter-spacing: 0.2em; }
.brand-main { font-size: 17px; font-weight: 800; letter-spacing: 0.02em; }
.site-nav { display: flex; gap: 2px; margin-left: auto; overflow-x: auto; scrollbar-width: none; }
.site-nav::-webkit-scrollbar { display: none; }
.site-nav a {
  white-space: nowrap; text-decoration: none; font-size: 13.5px; font-weight: 700;
  padding: 6px 10px; border-radius: 999px; border: 1.5px solid transparent;
}
.site-nav a:hover { background: var(--wash); }
.site-nav a[aria-current="page"] { background: var(--ink); color: var(--plane); }

/* 幅が足りないときは、1段目にロゴと年度、2段目にメニュー */
@media (max-width: 1180px) {
  .site-header { flex-wrap: wrap; gap: 6px 12px; padding-bottom: 6px; }
  .site-nav { margin-left: 0; width: 100%; }
  .year-switch { margin-left: auto; }
}
@media (max-width: 760px) {
  .site-nav a { padding: 5px 10px; font-size: 13px; }
}

/* 年度スイッチ（どのページでも同じ場所に出す） */
.year-switch { display: inline-flex; align-items: center; gap: 2px; border: 1.500px solid var(--ink); border-radius: 999px; padding: 2px; background: var(--surface); flex: none; }
.year-switch[hidden] { display: none; }
.year-switch .ys-label { font-size: 11px; font-weight: 800; padding: 0 6px 0 9px; color: var(--text-2); }
.year-switch a { text-decoration: none; font-size: 13px; font-weight: 800; padding: 4px 11px; border-radius: 999px; line-height: 1.400; }
.year-switch a:hover { background: var(--wash); }
.year-switch a[aria-current="true"] { background: var(--accent); color: #0b0b0b; box-shadow: inset 0 0 0 1.500px var(--ink); }

/* ---------- 共通レイアウト ---------- */
.wrap { max-width: 1180px; margin: 0 auto; padding: 0 clamp(16px, 4vw, 40px); }
.section { padding: clamp(44px, 7vw, 88px) 0; }
.section + .section { border-top: 1.5px solid var(--ink); }
/* 追従するセクション名 */
.split { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: clamp(20px, 4vw, 56px); }
.split-label { position: sticky; top: calc(var(--hh, 60px) + 64px); align-self: start; }
.split-label .en { display: block; font-size: 13px; font-weight: 800; letter-spacing: 0.22em; color: var(--text-2); }
.split-label h2 { font-size: clamp(24px, 3vw, 32px); font-weight: 800; line-height: 1.3; margin-top: 6px; }
.split-label p { font-size: 14px; color: var(--text-2); margin-top: 12px; }
@media (max-width: 860px) {
  .split { grid-template-columns: 1fr; }
  .split-label { position: static; }
}

/* 二段見出し: 問いかけ + 正式な統計名 */
.q { font-size: clamp(19px, 2.2vw, 23px); font-weight: 800; line-height: 1.4; }
.q-sub { font-size: 12.5px; color: var(--muted); font-weight: 600; margin-top: 2px; }
.q-sub::before, .q-sub::after { content: "―"; margin: 0 4px; }

.card {
  background: var(--surface); border: 1.5px solid var(--ink); border-radius: var(--radius);
  padding: clamp(18px, 2.4vw, 28px);
}
.card.pop { box-shadow: var(--shadow); }
.chip {
  display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 700;
  padding: 2px 10px; border-radius: 999px; border: 1.5px solid var(--ink); background: var(--surface); white-space: nowrap;
}
.chip.solid { background: var(--ink); color: var(--plane); }
.dot { width: 10px; height: 10px; border-radius: 3px; flex: none; background: var(--c-other); }
.btn {
  display: inline-flex; align-items: center; gap: 8px; cursor: pointer; text-decoration: none;
  font-weight: 800; font-size: 15px; padding: 10px 18px; border-radius: 999px;
  border: 1.5px solid var(--ink); background: var(--surface); box-shadow: 3px 3px 0 var(--ink);
  transition: transform .12s, box-shadow .12s;
}
.btn:hover { transform: translate(-1px, -1px); box-shadow: 4px 4px 0 var(--ink); }
.btn:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--ink); }
.btn.primary { background: var(--accent); color: #0b0b0b; }
.btn.small { font-size: 13px; padding: 6px 13px; box-shadow: 2px 2px 0 var(--ink); }
.linkish { background: none; border: 0; padding: 0; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; font-weight: 700; }

/* 吹き出し */
.bubble {
  position: relative; background: var(--surface); border: 1.5px solid var(--ink); border-radius: 16px;
  padding: 12px 16px; font-size: 14.5px; line-height: 1.7;
}
.bubble::after {
  content: ""; position: absolute; left: 28px; bottom: -9px; width: 14px; height: 14px; background: var(--surface);
  border-right: 1.5px solid var(--ink); border-bottom: 1.5px solid var(--ink); transform: rotate(45deg);
}
.bubble.flat::after { display: none; }

/* ---------- ヒーロー ---------- */
.hero { background: var(--accent); color: #0b0b0b; border-bottom: 1.5px solid var(--ink); overflow: hidden; }
.hero-in { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr); gap: 24px; align-items: center; padding-top: clamp(36px, 6vw, 76px); padding-bottom: clamp(40px, 6vw, 72px); }
.hero .eyebrow { display: inline-block; font-size: 13px; font-weight: 800; letter-spacing: 0.08em; border: 1.5px solid #0b0b0b; border-radius: 999px; padding: 3px 12px; background: #fcfcfb; }
.hero h1 { font-size: clamp(32px, 5vw, 58px); line-height: 1.25; font-weight: 800; letter-spacing: 0.01em; margin-top: 18px; }
.hero h1 .mark { background: linear-gradient(transparent 62%, #fcfcfb 62%); }
.hero .lead { font-size: clamp(15px, 1.6vw, 17.5px); margin-top: 18px; max-width: 34em; font-weight: 600; }
.hero .lead b { font-weight: 800; }
.search {
  display: flex; gap: 8px; margin-top: 24px; max-width: 560px; position: relative;
}
.search input {
  flex: 1; min-width: 0; height: 52px; border-radius: 999px; border: 1.5px solid #0b0b0b; padding: 0 20px;
  background: #fcfcfb; color: #0b0b0b; font-size: 16px; box-shadow: 3px 3px 0 #0b0b0b;
}
.search input::placeholder { color: #7a7872; }
.search .btn { height: 52px; background: #0b0b0b; color: #fcfcfb; border-color: #0b0b0b; box-shadow: none; }
.suggest {
  position: absolute; left: 0; right: 0; top: 58px; z-index: 20; background: #fcfcfb; color: #0b0b0b;
  border: 1.5px solid #0b0b0b; border-radius: 16px; box-shadow: 4px 4px 0 #0b0b0b; padding: 6px; max-height: 320px; overflow: auto;
}
.suggest a { display: flex; justify-content: space-between; gap: 12px; padding: 9px 12px; border-radius: 10px; text-decoration: none; font-weight: 700; }
.suggest a:hover, .suggest a.on { background: #fff1b8; }
.suggest small { color: #7a7872; font-weight: 600; }
.hero-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; align-items: center; font-size: 13px; font-weight: 700; }
.hero-tags button { cursor: pointer; background: transparent; border: 1.5px solid #0b0b0b; border-radius: 999px; padding: 3px 12px; font-size: 13px; font-weight: 700; color: #0b0b0b; }
.hero-tags button:hover { background: #fcfcfb; }
.hero-art { position: relative; min-height: 320px; padding: 64px 0 76px; }
.hero-art svg { width: 100%; height: auto; display: block; }
.hero-art .bubble { position: absolute; color: #0b0b0b; background: #fcfcfb; border-color: #0b0b0b; max-width: 250px; font-weight: 700; font-size: 13.5px; }
.hero-art .bubble::after { background: #fcfcfb; border-color: #0b0b0b; }
.hero-art .b1 { top: 0; left: 0; }
.hero-art .b2 { bottom: 0; right: 0; }
.hero-art .b2::after { left: auto; right: 34px; top: -9px; bottom: auto; transform: rotate(225deg); }
@media (max-width: 860px) {
  .hero-in { grid-template-columns: 1fr; }
  .hero-art { min-height: 0; max-width: 420px; margin: 0 auto; padding: 0; }
  .hero-art .bubble { position: static; max-width: none; margin: 10px 0; }
  .hero-art .bubble::after { display: none; }
}
.float { animation: float 6s ease-in-out infinite; transform-origin: center; }
.float.d2 { animation-delay: -2s; } .float.d3 { animation-delay: -4s; }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-7px); } }

/* ---------- 数字タイル ---------- */
.bento { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 16px; }
.tile { grid-column: span 3; display: flex; flex-direction: column; gap: 14px; }
.tile.w6 { grid-column: span 6; } .tile.w4 { grid-column: span 4; } .tile.w2 { grid-column: span 2; }
@media (max-width: 980px) { .tile, .tile.w4, .tile.w2 { grid-column: span 6; } }
.big { font-size: clamp(40px, 6.4vw, 76px); font-weight: 800; line-height: 1; white-space: nowrap; }
.big.mid { font-size: clamp(30px, 4vw, 50px); }
.big small, .unit { font-size: 0.36em; font-weight: 800; margin-left: 4px; letter-spacing: 0; }
.tile-note { font-size: 13.5px; color: var(--text-2); line-height: 1.7; }
.badge-round {
  display: inline-grid; place-items: center; width: 54px; height: 54px; border-radius: 50%; flex: none;
  background: var(--ink); color: var(--plane); font-size: 11px; font-weight: 800; line-height: 1.2; text-align: center;
}
.row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.stack-v { display: flex; flex-direction: column; gap: 10px; }

/* ---------- グラフ部品 ---------- */
.seg-bar { display: flex; gap: 2px; height: 22px; width: 100%; }
.seg-bar.thin { height: 12px; }
.seg { min-width: 2px; height: 100%; border-radius: 0; transition: filter .15s, transform .15s; cursor: default; }
.seg:first-child { border-radius: 4px 0 0 4px; }
.seg:last-child { border-radius: 0 4px 4px 0; }
.seg:only-child { border-radius: 4px; }
.seg:hover, .seg:focus-visible { filter: brightness(1.12); }
.grow { transform-origin: left center; animation: grow .8s cubic-bezier(.2,.8,.2,1) both; }
@keyframes grow { from { transform: scaleX(0); } to { transform: scaleX(1); } }
.rise { transform-origin: center bottom; animation: rise .7s cubic-bezier(.2,.8,.2,1) both; }
@keyframes rise { from { transform: scaleY(0); } to { transform: scaleY(1); } }

.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 13px; color: var(--text-2); }
.legend .item { display: inline-flex; align-items: center; gap: 6px; }
.legend button.item { background: none; border: 0; padding: 2px 4px; border-radius: 6px; cursor: pointer; color: inherit; }
.legend button.item:hover { background: var(--wash); }
.legend button.item[aria-pressed="false"] { opacity: 0.4; text-decoration: line-through; }
.legend b { color: var(--text); font-weight: 700; }

/* 横棒（項目別） */
.hbars { display: grid; gap: 14px; }
.hbar { display: grid; grid-template-columns: minmax(8.5em, 11em) minmax(0, 1fr) minmax(6.5em, auto); gap: 4px 14px; align-items: center; }
.hbar .name { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 14.5px; }
.hbar .track { position: relative; height: 18px; border-left: 1px solid var(--axis); }
.hbar .fill { position: absolute; left: 0; top: 2px; bottom: 2px; border-radius: 0 4px 4px 0; min-width: 1px; }
.hbar .avg { position: absolute; top: -3px; bottom: -3px; width: 2px; background: var(--ink); border-radius: 1px; }
.hbar .val { text-align: right; font-weight: 800; font-size: 15px; }
.hbar .val small { display: block; font-weight: 600; font-size: 12px; color: var(--muted); }
.hbar .note { grid-column: 2 / -1; font-size: 12.5px; color: var(--text-2); line-height: 1.5; }
.hbar.zero .name, .hbar.zero .val { color: var(--muted); }
@media (max-width: 620px) {
  .hbar { grid-template-columns: 1fr auto; }
  .hbar .track { grid-column: 1 / -1; order: 3; }
  .hbar .note { grid-column: 1 / -1; order: 4; }
}
.cat-ico { width: 22px; height: 22px; flex: none; }

/* 縦棒（月別） */
.cols { position: relative; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); align-items: end; gap: 0; height: 190px; padding-left: 46px; }
.cols .grid-line { position: absolute; left: 46px; right: 0; height: 1px; background: var(--hair); }
.cols .grid-line span { position: absolute; left: -46px; top: -9px; width: 40px; text-align: right; font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }
.cols .base { position: absolute; left: 46px; right: 0; bottom: 0; height: 1px; background: var(--axis); }
.col { position: relative; height: 100%; display: flex; align-items: flex-end; justify-content: center; cursor: default; outline-offset: -2px; }
.col:hover, .col:focus-visible { background: var(--wash); }
.col .stack { width: min(24px, 62%); display: flex; flex-direction: column-reverse; gap: 2px; }
.col .stack i { display: block; width: 100%; }
.col .stack i:last-child { border-radius: 4px 4px 0 0; }
.cols-x { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); padding-left: 46px; font-size: 11.5px; color: var(--muted); text-align: center; margin-top: 6px; }

/* マス目（24万円の使いみち） */
.waffle { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 5px; max-width: 360px; }
.waffle i { aspect-ratio: 1; border-radius: 6px; display: block; animation: pop .45s cubic-bezier(.2,1.4,.4,1) both; }
@keyframes pop { from { transform: scale(0); opacity: 0; } to { transform: scale(1); opacity: 1; } }

/* お金の流れ */
.flow { display: grid; gap: 10px; }
.flow-bar { display: flex; gap: 2px; height: 46px; }
.flow-bar > div { display: flex; align-items: center; padding: 0 12px; font-weight: 800; font-size: 13px; white-space: nowrap; overflow: hidden; min-width: 0; }
.flow-bar .used { background: var(--ink); color: var(--plane); border-radius: 6px 0 0 6px; }
.flow-bar .back { background: var(--c-rest); color: var(--text); border-radius: 0 6px 6px 0; justify-content: center; padding: 0 4px; font-size: 12px; }
.flow-keys { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; }
.flow-keys .k { border-top: 3px solid var(--ink); padding-top: 8px; }
.flow-keys .k.rest { border-color: var(--c-rest); }
.flow-keys .k.out { border-color: var(--axis); border-top-style: dotted; }
.flow-keys .k span { font-size: 12.5px; color: var(--text-2); font-weight: 700; display: block; }
.flow-keys .k b { font-size: clamp(20px, 2.4vw, 26px); font-weight: 800; }

details.table-view { font-size: 13px; }
details.table-view summary { cursor: pointer; color: var(--text-2); font-weight: 700; width: fit-content; }
details.table-view table { margin-top: 8px; }
table { border-collapse: collapse; width: 100%; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--hair); vertical-align: top; }
th { font-size: 12.5px; color: var(--text-2); font-weight: 700; white-space: nowrap; }
td.r, th.r { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }

.tooltip {
  position: fixed; z-index: 80; pointer-events: none; max-width: 300px; background: var(--ink); color: var(--plane);
  border-radius: 10px; padding: 9px 12px; font-size: 12.5px; line-height: 1.55; box-shadow: 0 6px 20px rgba(0,0,0,.25);
}
.tooltip b { font-size: 15px; display: block; }
.tooltip .tt-row { display: flex; justify-content: space-between; gap: 14px; }
.tooltip .tt-row i { display: inline-block; width: 10px; height: 3px; border-radius: 2px; margin-right: 6px; vertical-align: middle; }
.tooltip .tt-head { opacity: .75; font-weight: 700; margin-bottom: 2px; }

/* ---------- 人のカード ---------- */
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 18px; }
.toolbar input[type="search"], .toolbar select {
  height: 42px; border-radius: 999px; border: 1.5px solid var(--ink); background: var(--surface); padding: 0 16px; font-size: 14.5px; min-width: 0;
}
.toolbar input[type="search"] { flex: 1 1 220px; }
.toolbar .count { font-size: 13px; color: var(--text-2); font-weight: 700; margin-left: auto; }
.seg-ctrl { display: inline-flex; border: 1.5px solid var(--ink); border-radius: 999px; overflow: hidden; background: var(--surface); }
.seg-ctrl button { border: 0; background: none; padding: 8px 14px; font-size: 13.5px; font-weight: 700; cursor: pointer; }
.seg-ctrl button[aria-pressed="true"] { background: var(--ink); color: var(--plane); }
.people { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; }
.person {
  display: flex; flex-direction: column; gap: 10px; text-decoration: none; background: var(--surface);
  border: 1.5px solid var(--ink); border-radius: 16px; padding: 16px; transition: transform .12s, box-shadow .12s;
}
.person:hover, .person:focus-visible { transform: translate(-2px, -2px); box-shadow: var(--shadow); }
.person .nm { font-size: 19px; font-weight: 800; line-height: 1.3; }
.person .amt { font-size: 24px; font-weight: 800; line-height: 1.1; }
.person .amt small { font-size: 12px; font-weight: 700; color: var(--text-2); margin-left: 4px; }
.person .meta { font-size: 12.5px; color: var(--text-2); display: flex; justify-content: space-between; gap: 8px; }
.person .top { font-size: 12.5px; color: var(--text-2); display: flex; align-items: center; gap: 6px; }

/* ---------- 項目カード ---------- */
.cats { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
.catcard { text-decoration: none; display: flex; flex-direction: column; gap: 8px; background: var(--surface); border: 1.5px solid var(--ink); border-radius: 16px; padding: 16px; position: relative; overflow: hidden; transition: transform .12s, box-shadow .12s; }
.catcard:hover, .catcard:focus-visible { transform: translate(-2px, -2px); box-shadow: var(--shadow); }
.catcard::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 8px; background: var(--cc, var(--c-other)); }
.catcard > * { margin-left: 8px; }
.catcard h3 { font-size: 17px; font-weight: 800; display: flex; align-items: center; gap: 8px; }
.catcard .plain { font-size: 13px; color: var(--text-2); line-height: 1.55; }
.catcard .amt { font-size: 22px; font-weight: 800; }
.catcard .amt small { font-size: 12.5px; font-weight: 700; color: var(--text-2); margin-left: 6px; }
.words { display: flex; flex-wrap: wrap; gap: 8px; }
.word { cursor: pointer; text-decoration: none; display: inline-flex; align-items: baseline; gap: 6px; padding: 6px 14px; border-radius: 999px; border: 1.5px solid var(--ink); background: var(--surface); font-weight: 800; font-size: 14.5px; transition: transform .12s, box-shadow .12s; }
.word:hover { transform: translate(-1px, -1px); box-shadow: 3px 3px 0 var(--ink); background: var(--accent-soft); }
.word small { font-size: 11.5px; color: var(--text-2); font-weight: 700; }

/* ---------- ルール ---------- */
.rules { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; }
.rules ul { margin: 10px 0 0; padding-left: 1.2em; font-size: 14.5px; }
.rules li { margin: 4px 0; }
.src { font-size: 12.5px; color: var(--text-2); margin-top: 12px; }

/* ---------- 個別ページ ---------- */
.page-head { background: var(--surface); border-bottom: 1.5px solid var(--ink); padding: clamp(24px, 4vw, 44px) 0; }
.crumb { font-size: 13px; font-weight: 700; color: var(--text-2); margin-bottom: 10px; }
.crumb a { text-decoration: none; } .crumb a:hover { text-decoration: underline; }
.page-head h1 { font-size: clamp(30px, 5vw, 50px); font-weight: 800; line-height: 1.2; }
.page-head .sub { margin-top: 10px; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; font-size: 14px; color: var(--text-2); }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(215px, 1fr)); gap: 14px; margin-top: 22px; }
.kpi { border: 1.5px solid var(--ink); border-radius: 14px; padding: 14px 16px; background: var(--plane); }
.kpi .lb { font-size: 12.5px; font-weight: 700; color: var(--text-2); }
.kpi .v { font-size: clamp(20px, 2.300vw, 28px); font-weight: 800; line-height: 1.3; white-space: nowrap; }
.kpi .v small { font-size: 13px; margin-left: 2px; }
.kpi .ex { font-size: 12px; color: var(--text-2); line-height: 1.5; margin-top: 2px; }
.meter { height: 10px; border-radius: 5px; background: color-mix(in srgb, var(--seq) 22%, var(--surface)); overflow: hidden; margin-top: 8px; }
.meter i { display: block; height: 100%; background: var(--seq); border-radius: 5px; }
.grid2 { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr); gap: 16px; }
@media (max-width: 900px) { .grid2 { grid-template-columns: 1fr; } }
.block { padding: clamp(28px, 4vw, 48px) 0; }
.block > .wrap > .q { margin-bottom: 4px; }
.block .card { margin-top: 16px; }
.docs { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.doc { display: flex; gap: 12px; align-items: center; text-decoration: none; border: 1.5px solid var(--ink); border-radius: 14px; padding: 12px 14px; background: var(--surface); transition: transform .12s, box-shadow .12s; }
.doc:hover { transform: translate(-1px, -1px); box-shadow: 3px 3px 0 var(--ink); }
.doc svg { width: 30px; height: 30px; flex: none; }
.doc b { display: block; font-size: 14.5px; line-height: 1.35; }
.doc small { color: var(--text-2); font-size: 12px; }
.verify { display: flex; gap: 12px; align-items: flex-start; font-size: 13.5px; line-height: 1.65; border-radius: 14px; padding: 12px 14px; background: var(--wash); }
.verify svg { width: 22px; height: 22px; flex: none; margin-top: 2px; }

/* 明細 */
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0; }
.fchip { cursor: pointer; display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 700; padding: 5px 12px; border-radius: 999px; border: 1.5px solid var(--ink); background: var(--surface); }
.fchip[aria-pressed="true"] { background: var(--ink); color: var(--plane); }
.fchip small { font-weight: 600; opacity: .7; }
.ledger-wrap { overflow-x: auto; border: 1.5px solid var(--ink); border-radius: 14px; background: var(--surface); }
.ledger { min-width: 640px; font-size: 14px; }
.ledger th { position: sticky; top: 0; background: var(--surface); }
.ledger td.d { white-space: nowrap; font-variant-numeric: tabular-nums; color: var(--text-2); }
.ledger td.c { white-space: nowrap; }
.ledger td.t .th { display: block; font-size: 12px; color: var(--muted); }
.ledger td.who a { font-weight: 700; text-decoration: none; white-space: nowrap; } .ledger td.who a:hover { text-decoration: underline; }
.ledger td.a { font-weight: 800; }
.ledger tr.in td { background: var(--wash); }
.ledger tr:last-child td { border-bottom: 0; }
.ledger .flag { font-size: 11px; font-weight: 700; color: var(--text-2); border: 1px solid var(--axis); border-radius: 6px; padding: 0 5px; margin-left: 6px; white-space: nowrap; }
.ledger mark { background: var(--accent-soft); color: inherit; border-radius: 3px; padding: 0 1px; }
.more { display: flex; justify-content: center; margin-top: 16px; }
.empty { padding: 36px 16px; text-align: center; color: var(--text-2); }
.summary-line { font-size: 15px; font-weight: 700; margin: 4px 0 2px; }
.summary-line b { font-size: 22px; font-weight: 800; }

/* くらべる */
.heat-wrap { overflow-x: auto; border: 1.5px solid var(--ink); border-radius: 14px; background: var(--surface); }
.heat { font-size: 13px; min-width: 780px; }
.heat th { position: sticky; top: 0; background: var(--surface); z-index: 2; vertical-align: bottom; }
.heat th button { background: none; border: 0; padding: 0; font-weight: 700; font-size: 12.5px; color: var(--text-2); cursor: pointer; text-align: right; line-height: 1.35; }
.heat th button[aria-sort] { color: var(--text); }
.heat th:first-child, .heat td:first-child { position: sticky; left: 0; background: var(--surface); z-index: 1; text-align: left; min-width: 9.5em; }
.heat th:first-child { z-index: 3; }
.heat td { padding: 0; border-bottom: 2px solid var(--surface); border-right: 2px solid var(--surface); }
.heat td:first-child { padding: 7px 10px; border-bottom: 1px solid var(--hair); }
.heat td:first-child a { font-weight: 700; text-decoration: none; } .heat td:first-child a:hover { text-decoration: underline; }
.heat td .cell { display: block; padding: 7px 10px; text-align: right; font-variant-numeric: tabular-nums; border-radius: 4px; }
.scale { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--text-2); }
.scale i { display: block; width: 120px; height: 10px; border-radius: 5px; background: linear-gradient(90deg, color-mix(in srgb, var(--seq) 6%, var(--surface)), var(--seq)); }

.prose { font-size: 15.5px; max-width: 46em; }
.prose h2 { font-size: 22px; font-weight: 800; margin: 34px 0 8px; }
.prose h2:first-child { margin-top: 0; }
.prose p { margin: 10px 0; }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose li { margin: 6px 0; }

.site-footer { border-top: 1.5px solid var(--ink); padding: 28px clamp(16px, 4vw, 40px) 44px; font-size: 13.5px; line-height: 1.8; max-width: 1180px; margin: 0 auto; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  html { scroll-behavior: auto; }
}
@media print {
  .site-header, .site-nav, .search, .toolbar, .filters, .more { display: none !important; }
  body { background: #fff; }
}

/* ---------- 年度をまたぐ表示 ---------- */
.yrows { display: grid; gap: 8px; }
.yrow { display: grid; grid-template-columns: 6.500em minmax(0, 1fr) minmax(7.500em, auto); gap: 6px 14px; align-items: center; padding: 10px 12px; border-radius: 12px; text-decoration: none; border: 1.500px solid transparent; }
a.yrow:hover { background: var(--wash); }
.yrow.on { border-color: var(--ink); background: var(--plane); }
.yrow .yl { font-weight: 800; font-size: 15px; line-height: 1.300; }
.yrow .yl small { display: block; font-size: 11px; font-weight: 700; color: var(--text-2); }
.yrow .yv { text-align: right; font-weight: 800; font-size: 17px; line-height: 1.300; }
.yrow .yv small { display: block; font-size: 12px; font-weight: 600; color: var(--muted); }
.ytrack { position: relative; height: 22px; border-left: 1px solid var(--axis); }
.ytrack .yfill { height: 100%; min-width: 2px; }
.ytrack .gline { position: absolute; top: -5px; bottom: -5px; width: 0; border-left: 2px dotted var(--ink); }
.gkey { display: inline-block; width: 0; height: 14px; border-left: 2px dotted var(--ink); }
@media (max-width: 620px) {
  .yrow { grid-template-columns: 1fr auto; }
  .yrow .ytrack { grid-column: 1 / -1; order: 3; }
}
.ystrip { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 10px; }
.ycell { display: block; text-decoration: none; border: 1.500px solid var(--hair); border-radius: 12px; padding: 10px 12px; }
.ycell:hover { border-color: var(--ink); }
.ycell.on { border-color: var(--ink); background: var(--plane); }
.ycell .yl { font-weight: 800; font-size: 14px; }
.ycell .ybar { height: 10px; margin: 6px 0; border-left: 1px solid var(--axis); }
.ycell .ybar i { display: block; height: 100%; border-radius: 0 4px 4px 0; min-width: 2px; }
.ychip { display: inline-block; margin-left: 6px; font-size: 10.500px; font-weight: 800; padding: 0 6px; border: 1px solid var(--axis); border-radius: 6px; color: var(--text-2); }
.ycards { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.ycard { display: flex; flex-direction: column; gap: 10px; text-decoration: none; transition: transform .12s; }
.ycard:hover { transform: translate(-2px, -2px); }
.mini-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.mini { display: flex; flex-direction: column; gap: 8px; text-decoration: none; background: var(--surface); border: 1.500px solid var(--ink); border-radius: 14px; padding: 14px; transition: transform .12s, box-shadow .12s; }
.mini:hover { transform: translate(-2px, -2px); box-shadow: var(--shadow); }
.mini-cols { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); align-items: end; gap: 8px; height: 104px; border-bottom: 1px solid var(--axis); }
.mini-col { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 3px; height: 100%; position: relative; padding-bottom: 0; }
.mini-col span { font-size: 12px; font-weight: 800; }
.mini-col i { display: block; width: min(24px, 60%); border-radius: 4px 4px 0 0; }
.mini-col small { position: absolute; bottom: -20px; font-size: 11px; color: var(--muted); }
.mini .tile-note { margin-top: 18px; }
.ptable td .barcell { text-decoration: none; position: relative; background: linear-gradient(90deg, color-mix(in srgb, var(--seq) 26%, var(--surface)) var(--w), transparent var(--w)); }
.ptable td .barcell:hover { outline: 1.500px solid var(--ink); }

/* ---------- 改良: 目次・説明の小窓・原本への導線・絞り込み ---------- */
.toc { position: sticky; top: var(--hh, 60px); z-index: 20; background: color-mix(in srgb, var(--surface) 94%, transparent); backdrop-filter: blur(8px); border-bottom: 1.500px solid var(--ink); }
.toc .wrap { display: flex; align-items: center; gap: 4px; overflow-x: auto; scrollbar-width: none; padding-top: 7px; padding-bottom: 7px; }
.toc .wrap::-webkit-scrollbar { display: none; }
.toc-label { font-size: 11px; font-weight: 800; color: var(--text-2); letter-spacing: .08em; margin-right: 6px; white-space: nowrap; }
.toc button { white-space: nowrap; border: 1.500px solid var(--hair); background: var(--surface); border-radius: 999px; padding: 4px 12px; font-size: 13px; font-weight: 700; cursor: pointer; }
.toc button:hover { border-color: var(--ink); background: var(--accent-soft); }
dialog.info { border: 1.500px solid var(--ink); border-radius: 18px; padding: 22px 24px; max-width: min(560px, calc(100vw - 32px)); background: var(--surface); color: var(--text); box-shadow: 6px 6px 0 var(--ink); }
dialog.info::backdrop { background: rgba(0, 0, 0, .45); }
dialog.info h2 { font-size: 20px; font-weight: 800; margin-bottom: 10px; }
dialog.info p { margin: 8px 0; font-size: 14.500px; line-height: 1.750; }
.catbtn { display: inline-flex; align-items: center; gap: 6px; background: none; border: 0; padding: 2px 4px; margin: -2px -4px; border-radius: 8px; cursor: pointer; font-weight: inherit; text-align: left; text-decoration: underline dotted var(--axis); text-underline-offset: 4px; }
.catbtn:hover { background: var(--wash); text-decoration-color: var(--ink); }
.hbar .name .catbtn { gap: 8px; font-weight: 700; }
.linkish.sm { font-size: 12.500px; font-weight: 700; margin-left: 8px; }
.ledger .flag.link { cursor: pointer; background: var(--accent-soft); border-color: var(--ink); color: var(--text); }
.ledger .flag.warn, .flag.warn { border-color: var(--ink); background: var(--wash); }
.flag.warn { font-size: 11px; font-weight: 700; border: 1px solid var(--ink); border-radius: 6px; padding: 0 5px; margin-left: 6px; white-space: nowrap; }
.ledger details.rd { display: inline-block; margin-left: 6px; font-size: 12px; color: var(--text-2); vertical-align: top; }
.ledger details.rd summary { cursor: pointer; display: inline-block; border: 1px solid var(--axis); border-radius: 6px; padding: 0 5px; font-size: 11px; font-weight: 700; list-style: none; }
.ledger details.rd summary::-webkit-details-marker { display: none; }
.ledger details.rd[open] { display: block; margin: 6px 0 0; padding: 8px 10px; background: var(--wash); border-radius: 8px; }
.ledger td.o { font-size: 12.500px; line-height: 1.600; color: var(--text-2); }
.ledger td.o .no { display: block; font-size: 13px; }
.ledger td.o a { display: block; white-space: nowrap; font-weight: 700; }
.ledger tr.focus td { background: var(--accent-soft); }
.ledger tr.focus td:first-child { box-shadow: inset 4px 0 0 var(--ink); }
.biglist { padding: 6px; }
.biglist button { display: flex; justify-content: space-between; align-items: center; gap: 14px; width: 100%; text-align: left; background: none; border: 0; border-bottom: 1px solid var(--hair); padding: 10px 12px; cursor: pointer; border-radius: 10px; }
.biglist button:last-child { border-bottom: 0; }
.biglist button:hover { background: var(--accent-soft); }
.biglist b { display: block; font-size: 14.500px; line-height: 1.450; }
.biglist small { display: flex; align-items: center; gap: 6px; font-size: 12.500px; color: var(--text-2); margin-top: 2px; }
.biglist strong { font-weight: 800; white-space: nowrap; }
.quickdocs { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; margin-top: 12px; font-size: 13.500px; }
.quickdocs > span { font-size: 11.500px; font-weight: 800; color: var(--text-2); border: 1.500px solid var(--ink); border-radius: 6px; padding: 0 7px; }
.quickdocs a { font-weight: 700; }
.roster { margin-top: 12px; padding: 12px 14px; border-radius: 14px; background: var(--wash); font-size: 14px; line-height: 1.750; }
.roster p + p { margin-top: 6px; }
.roster small { color: var(--text-2); }
.person .via { font-size: 12.500px; font-weight: 700; margin-top: -4px; }
.person .via.muted { font-weight: 600; }
.totals { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 10px; }
.totals > div { border: 1.500px solid var(--hair); border-radius: 12px; padding: 10px 12px; display: flex; flex-direction: column; }
.totals span { font-size: 12px; font-weight: 800; color: var(--text-2); }
.totals b { font-size: 19px; font-weight: 800; }
.totals small, .totals a { font-size: 12px; color: var(--text-2); line-height: 1.500; }
.totals a { color: var(--text); font-weight: 700; }
.toolbar.narrow select { height: 38px; font-size: 13.500px; flex: 1 1 150px; }
.found { margin-top: 12px; font-size: 14.500px; font-weight: 700; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; }
.found b { font-size: 20px; font-weight: 800; }
.bubble.from { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin: 4px 0 12px; }
.empty-card { display: flex; flex-direction: column; gap: 12px; align-items: flex-start; }
.unit-tag { display: block; font-size: 10.500px; font-weight: 600; color: var(--muted); }
.table-scroll { overflow-x: auto; }
.prose table { font-size: 14px; margin: 10px 0; }

/* スマホでは明細を横スクロールの表ではなく、1件ずつのカードに組みかえる（金額と原本リンクが画面の外に出ないように） */
@media (max-width: 640px) {
  .ledger { min-width: 0; display: block; }
  .ledger thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .ledger tbody { display: block; }
  .ledger tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 3px 12px; padding: 12px 14px; border-bottom: 1px solid var(--hair); }
  .ledger tr:last-child { border-bottom: 0; }
  .ledger td { display: block; border: 0; padding: 0; }
  .ledger td.d { grid-column: 1; grid-row: 1; font-size: 12.500px; }
  .ledger td.a { grid-column: 2; grid-row: 1; font-size: 16px; }
  .ledger td.who, .ledger td.c, .ledger td.t, .ledger td.o { grid-column: 1 / -1; }
  .ledger td.c { white-space: normal; }
  .ledger td.t { font-size: 14.500px; }
  .ledger td.o { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 14px; text-align: left; margin-top: 4px; white-space: normal; }
  .ledger td.o .no, .ledger td.o a { display: inline; }
  .ledger tr.in { background: var(--wash); }
  .ledger tr.focus { background: var(--accent-soft); box-shadow: inset 4px 0 0 var(--ink); }
  .ledger tr.focus td:first-child { box-shadow: none; }
}
