.theme-color{
  /* 外側から上書きしやすいようCSS変数を用意 */
  --bg: #f3f5f7;          /* 内円(穴)の色。ページ背景に合わせる */
  --text: #111;           /* 基本文字色 */
  --title: #111;          /* タイトル文字色 */
  --muted: #6b7280;       /* 備考等 */
  --centerText: #148a4b;  /* 中央の数値色（画像の緑） */

  /* セグメント色（最大5） */
  --seg1: #cde95a;
  --seg2: #b7e26c;
  --seg3: #6fd05a;
  --seg4: #34b86a;
  --seg5: #1f9b63;
}

.donut-widget{

  /* 線・区切り */
  --separator: var(--bg);

  display: inline-block;
  color: var(--text);
  font-family: "Meiryo", "メイリオ", system-ui, -apple-system, "Segoe UI", sans-serif;

  /*display: grid;*/
  justify-items: center;
}

.donut-header{
  text-align: center;
  margin-bottom: 8px;
}


.donut-body{
  position: relative;
  /* 直径はJSが設定するが、念のため */
}

.donut-canvas{
  position: relative;
  display: grid;
  place-items: center;
}

/* 中央テキスト */
.donut-center{
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  pointer-events: none;
  text-align: center;
}

.donut-center-title{
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 20px;
  color: var(--text);
}

.donut-center-value{
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  line-height: 1;
}

.donut-center-number{
  font-size: 32px;
  font-weight: 800;
  color: var(--centerText);
  letter-spacing: 0.01em;
  margin-top: 40px;
}

.donut-center-unit{
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
}

/* 備考 */
.card-note{
  font-size: 10px;
}

/* 新卒出身学部の注釈：.metric-card .card-note(左寄せ)より詳細度を上げて中央揃え */
.metric-card.stem-chart .card-note{
  padding-top: 30px;
  text-align: center;
}

.stem-chart .donut-body{
  margin-left: auto;
  margin-right: auto;
}


/* SVG内の文字（%やラベル） */
.donut-svg text{
  font-family: inherit;
}

.donut-percent{
  fill: #fff;               /* 扇形内の％は白（画像風） */
  font-weight: 800;
  font-size: 16px;
  paint-order: stroke;
  stroke: rgba(0,0,0,.15);  /* 視認性補助（薄い縁） */
  stroke-width: 2px;
}

.donut-label{
  fill: var(--centerText);  /* 外側ラベル文字色（必要なら上書き） */
  font-weight: 800;
  font-size: 16px;
}

.stem-chart .donut-label{
  fill: var(--centerText);  /* 外側ラベル文字色（必要なら上書き） */
  font-weight: 800;
  font-size: 10px;
}

.donut-leader{
  stroke-width: 0.5px;
  fill: none;
}

/* 中央テキストの見た目中心を安定化 */
.donut-widget .donut-center{
  position: absolute !important;
  inset: 0 !important;
  display: grid !important;
  place-items: center !important;
  text-align: center !important;
  pointer-events: none;
}

/* 中央ブロックの縦方向を微調整（必要なら数値を増減） */
.donut-widget .donut-center{
  transform: translateY(-2%); /* 画像の状態だと少し上に上げると安定しやすい */
}

/* 行高と余白でズレないように */
.donut-widget .donut-center-title{
  line-height: 1.1;
  margin: 80px 0 4px 0;
}
.donut-widget .donut-center-value{
  line-height: 1;
  margin: 0;
}

/* 数値と単位がベースラインで暴れないように */
.donut-widget .donut-center-number,
.donut-widget .donut-center-unit{
  line-height: 1;
  display: inline-block;
}




/* 外側ラベルを切らない */
.donut-widget .donut-body,
.donut-widget .donut-canvas,
.donut-widget .donut-svg{
  overflow: visible !important;
}

/* ついでに線は細め */
.donut-widget .donut-leader{
  stroke-width: 1.1px;
  stroke-linecap: round;
}




.donut-widget {
  --label-pad: 42px; /* 左右のラベル余白（必要なら増やす） */
  margin: 0 auto;

}
.donut-widget .donut-body{
  position: relative;
  /*padding-left: var(--label-pad);
  padding-right: var(--label-pad);*/
  box-sizing: content-box;
}
.donut-widget .donut-center{
  /* 中央テキストは円の上に載せたいので、パディング分だけ内側に */
  left: var(--label-pad);
  right: var(--label-pad);
}

.donut-widget .donut-center-value{
  transform: translateY(-70px); /* -2px〜-8pxで調整 */
}


/* 円グラフの基準箱 */
.donut-widget .donut-body{
  position: relative;
  width: var(--donut-size, 340px);  /* JSでwidth/heightを入れているなら不要 */
  height: var(--donut-size, 340px); /* JSでwidth/heightを入れているなら不要 */
}

/* SVGの器：常に中央寄せ */
.donut-widget .donut-canvas{
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;     /* ★これが中央固定の要 */
}

/* SVG：常に正方形領域いっぱい、かつブロック要素化 */
.donut-widget .donut-svg{
  display: block;
  width: 100%;
  height: 100%;
}





.gender-chart {
  position: relative;
  /*width: 360px;        /* 全体の横幅（調整可） */
  /*margin: 0 auto;*/
}

/* 円グラフ */
.chart-wrapper {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1; /* 正円を維持 */
}

.donut-chart {
  width: 100%;
  height: 100%;
}

/* 人物共通 */
.person {
  position: absolute;
  bottom: 20px;       /* 円の下に少しはみ出す */
  width: 100px;         /* 人物サイズ（調整ポイント） */
  pointer-events: none;
}

/* 左人物 */
.person-left {
  left: -20px;
  top: -25px;
}

/* 右人物 */
.person-right {
  right: -20px;
  top: 20px;
}



/* ===== 勤続年数 / 在宅勤務比率カード（埋め込み用） ===== */
.metric-card{
  box-sizing: border-box;
  text-align: center;
  padding: 0 5px;
}

/* 見出し */
.metric-title{
  display: inline-block;
  font-size: 20px;
  font-weight: 700;
  color: var(--title);
  letter-spacing: 0.02em;
  position: relative;
  padding-top: 10px;
  padding-bottom: 10px;
  text-decoration: underline;
  text-decoration-thickness: 2px;   /* 線の太さ */
  text-underline-offset: 8px;      /* 文字からの距離 */
  text-decoration-color: currentColor;
}


/* 本体 */
.metric-body{
  margin-top: 16px;
}

/* メイン数値 */
.metric-main{
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
  line-height: 1;
  margin: 6px 0 10px;
}

.metric-main-number{
  font-family: "Roboto Condensed", "Bebas Neue", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-weight: 300;
  font-size: 48px;
  color: #148a4b;
  letter-spacing: .01em;
}

.metric-main-unit{
  font-weight: 700;
  font-size: 18px;
  color: #0d0d0d;
}

/* 内訳（dl） */
.metric-sub{
  margin: 6px auto 0;
  max-width: 220px; /* 余白がきつければ調整 */
  display: grid;
  gap: 6px;
}

.metric-sub-row{
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: baseline;
  column-gap: 10px;
}

.metric-sub-label{
  margin-left:30px;
  text-align: left;
  font-weight: 700;
  color: #0d0d0d;
}

.metric-sub-note {
  text-align: center;
  font-size: 14px;
  color: #148a4b;
  margin-bottom: 20px;
}

.metric-sub-value{
  text-align: right;
  margin: 0; /* ddのデフォルトを消す */
}

.metric-sub-number{
  font-family: "Roboto Condensed", "Bebas Neue", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-weight: 300;
  font-size: 28px;
  color: #148a4b;
}

.metric-sub-unit{
  font-weight: 700;
  font-size: 14px;
  color: #0d0d0d;
  margin-left: 2px;
  margin-right: 30px;
}

/* 在宅勤務比率：画像枠（後で画像を入れる場所） */
.metric-figure{
  width: 160px;
  height: 110px;
  margin: 0 auto 10px;
  /* 今は空なので、レイアウト確認用に薄いガイド（不要なら削除） */
  /* border: 1px dashed rgba(0,0,0,.15); */
  border-radius: 8px;
}

/* 注釈（card-note転用）：カード内では余白だけ調整 */
.metric-card .card-note{
  text-align: left; /* 画像のように左寄せなら */
}


/* %の上に表示する説明（data-desc） */
.donut-widget .donut-desc{
  fill: #fff;
  font-weight: 700;
  font-size: 16px;
  paint-order: stroke;
  stroke: rgba(0,0,0,.18);
  stroke-width: 2px;
}

/* 横幅が足りないときは横スクロール（スマホ対策） */
.kpi-table-wrap{
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* 表の基本 */
.kpi-table{
  border-collapse: collapse;
  width: 100%;
  background: #fff;
}

.kpi-table th,
.kpi-table td{
  border: 1px solid rgba(0,0,0,.28);
  padding: 14px 16px;
  text-align: center;
  vertical-align: middle;
  background-color: rgb(247, 245, 245);
}

/* 左上の空セル */
.kpi-corner{
  width: 90px;
  background: #fff;
}

/* 年度見出し */
.kpi-table thead th{
  font-weight: 700;
  font-size: 14px;
  color: #0d0d0d;
  background-color: rgb(247, 245, 245);
}

/* 行見出し（男性/女性） */
.kpi-rowhead{
  font-weight: 800;
  color: #0d0d0d;
  width: 90px;
  padding: 0;
}
.kpi-rowhead-text{
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  margin: 0 auto;
  border-radius: 2px;
  color: #0d0d0d;
}

/* 行見出しの背景色（画像に近い色） */
.kpi-rowhead-male .kpi-rowhead-text{
  background: #cfe97a; /* 黄緑 */
}
.kpi-rowhead-female .kpi-rowhead-text{
  background: #1aa073; /* 濃い緑 */
  color: #ffffff;
}

/* セルの数値（0/1）と単位（名） */
.kpi-num{
  font-family: "Roboto Condensed", "Bebas Neue", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-weight: 300;
  font-size: 38px;
  line-height: 1;
  color: #148a4b;
  letter-spacing: .01em;
}
.kpi-unit{
  margin-left: 4px;
  font-weight: 700;
  font-size: 16px;
  color: #0d0d0d;
}

/* 余白調整（必要なら） */
.kpi-table td{
  white-space: nowrap;
}

/* このカードだけ縦並びに固定 */
.grid_elm.metric-card{
  display: flex;
  flex-direction: column;   /* ★横並び→縦並び */
  align-items: stretch;
  gap: 12px;                /* 任意：間隔 */
}

/* 念のため：各ブロックは幅100% */
.grid_elm.metric-card > .metric-header,
.grid_elm.metric-card > .metric-body,
.grid_elm.metric-card > .card-note{
  width: 100%;
  display: block;
}

.canvasWrap{ 
  position:relative; 
}
canvas{ 
  width:100%;
  height:260px;
  display:block; 
}

/* スマホ時などで少し小さく */
@media (max-width: 480px){
  .donut-title{ font-size: 18px; }
  .donut-center-number{ font-size: 30px; }
  .kpi-num{ font-size: 34px; }
  .kpi-rowhead-text{ width: 56px; height: 56px; }

  .metric-main-number{ font-size: 48px; }
  .metric-main-remote .metric-main-number{ font-size: 54px; }
  .metric-figure{ width: 140px; height: 96px; }

  .kpi-table th,
  .kpi-table td{
    padding: 0;
  }
  .kpi-table thead th{
    font-size: 12px;
  } 

  .kpi-num{
    font-size: 24px;
  }
  .kpi-unit{
    font-size: 12px;
  }
  .donut-label{
    font-size: 12px;
  }
}

.bar-card-header{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

/* タイトルは必要なら中央寄せも可能（今は左寄せ） */
.bar-card-title{
  font-weight: 700;
  font-size: 20px;
  white-space: nowrap;
}

/* 凡例を右に寄せて横並び */
.bar-card-legend{
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;            /* 文字が長い場合に折り返す */
  justify-content: flex-end;
  font-size: 12px;
  color: #111827;
}

.bar-card-legend .legend-item{
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.bar-card-legend .legend-swatch{
  width: 10px;
  height: 10px;
  border-radius: 2px;
  flex: 0 0 auto;
}

/* スマホで詰まるなら縦積み */
@media (max-width: 480px){
  .bar-card-header{
    align-items: flex-start;
    flex-direction: column;
  }
  .bar-card-legend{
    justify-content: flex-start;
  }
}

.bar-card-header{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
}

.bar-card-meta{
  display:flex;
  align-items:center;
  gap:12px;
  justify-content:flex-end;
  flex-wrap:wrap;
}

.bar-card-unit{
  font-size:12px;
  color:#6b7280;
  white-space:nowrap;
  margin-right:auto;
}



/* ===== 育児休職取得カード：イラスト左・数値右（2026-07 デザイン調整） ===== */
.metric-card.metric-childcare{
  display: grid;
  grid-template-columns: minmax(0, 50%) minmax(0, 1fr);
  grid-template-areas:
    "title title"
    "figure body"
    "note note";
  column-gap: 28px;
  align-items: center;
  text-align: left;
}
.metric-childcare .metric-header{
  grid-area: title;
  text-align: center;
}
.metric-childcare .metric-figure{
  grid-area: figure;
  width: 100%;
  height: auto;
  margin: 0;
  padding: 0 15%;
}
.metric-childcare .metric-figure img{
  display: block;
  width: 100%;
  max-width: 300px;
  height: auto;
  margin: 0 auto;
}
.metric-childcare .metric-body{
  grid-area: body;
  margin-top: 0;
  text-align: center;
}
.metric-childcare .metric-sub-row{
  display: block;
}
.metric-childcare .metric-sub-row + .metric-sub-row{
  margin-top: 18px;
}
.metric-childcare .metric-sub-label{
  display: block;
  margin-left: 0;
  text-align: center;
  font-size: 16px;
  line-height: 1.5;
}
.metric-childcare .metric-sub-value{
  text-align: center;
  margin-top: 2px;
}
.metric-childcare .metric-sub-number{
  font-size: 48px;
  line-height: 1.1;
}
.metric-childcare .metric-sub-unit{
  font-size: 18px;
  margin-left: 4px;
  margin-right: 0;
}
.metric-childcare .card-note{
  grid-area: note;
  margin-top: 14px;
}
@media (max-width: 520px){
  .metric-card.metric-childcare{
    display: block;
  }
  .metric-childcare .metric-figure{
    margin: 0 auto 12px;
    max-width: 240px;
  }
}

/* ===== ボードデザイン合わせの余白調整（2026-07） ===== */
/* カード間ガター（ボード実測 15.5/1248 ≒ コンテンツ幅の1.24%） */
.contents_data .grid{
  gap: 12px;
}
/* カード内枠：タイトル上と左右下の余白 */
.contents_data .grid_elm{
  padding: 14px 14px 16px;
}
/* 注釈はカード最下部に揃える（ボード準拠） */
.metric-card:not(.metric-childcare){
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
}
.metric-card:not(.metric-childcare) > .card-note{
  margin-top: auto;
  padding-top: 10px;
}
/* 注釈が連続する場合は行間を空けない */
.metric-card:not(.metric-childcare) > .card-note + .card-note{
  margin-top: 2px;
  padding-top: 0;
}
/* 本文ブロックは余った高さの中で中央寄せ */
.metric-card:not(.metric-childcare) > .metric-body{
  margin-top: auto;
}
.metric-childcare{
  width: 100%;
}

/* 男女割合の人物：トリミング済み書き出し（余白なし）用の配置
   旧: 510x1515の余白込みPNG前提だった位置決めを、絵の実寸基準に換算 */
.person-left{
  width: 75px;
  left: -62px;
  top: 107px;
}
.person-right{
  width: 80px;
  right: -59px;
  top: 109px;
}

/* SPでは人物をカード内に収める */
@media (max-width: 767px){
  .person-left{ width: 64px; left: -6px; top: 110px; }
  .person-right{ width: 68px; right: -6px; top: 112px; }
}
