/* ============================================================
   JIW 累積点検実績グラフ — スタイルシート
============================================================ */

.jiw-root {
  font-family: 'Noto Sans JP', sans-serif;
}

/* --------------------------------------------------
   全体実績ブロック（枠なし・背景透明・中央寄せ）
-------------------------------------------------- */
.jiw-summary {
  background: transparent;
  border: none;
  width: 100%;
  max-width: 980px;
  margin: 0 auto;
  box-sizing: border-box;
  padding: 0 1.5rem;
}

.jiw-summary-header {
  font-size: 21px;
  color: #004077;
  font-weight: 500;
  margin-bottom: 0.25rem;
  text-align: left;
}

.jiw-summary-header sup {
  font-size: 11px;
}

/* 左右カラム並び */
.jiw-summary-inner {
  display: flex;
  gap: 3rem;
  align-items: stretch;
  width: 100%;
  box-sizing: border-box;
}

/* 左カラム：総件数・凡例を上、注釈を下に固定 */
.jiw-summary-left {
  min-width: 220px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

/* 右カラム：グラフを上詰め */
.jiw-chart-area {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
}

/* 総件数 */
.jiw-total {
  line-height: 1;
  margin-bottom: 0.25rem;
}

.jiw-total .num {
  font-family: 'Barlow', sans-serif;
  font-size: 96px;
  font-weight: 700;
  color: #004077;
}

.jiw-total .unit {
  font-family: 'Noto Sans JP', sans-serif;
  font-size: 32px;
  font-weight: 700;
  color: #004077;
}

/* 凡例 */
.jiw-legend {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0.75rem 0 0;
}

.jiw-legend-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: #333;
}

.jiw-legend-swatch {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.jiw-legend-count {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 15px;
  font-weight: 700;
  color: #004077;
  margin-left: auto;
}

.jiw-legend-unit {
  font-family: 'Noto Sans JP', sans-serif;
  font-size: 12px;
}

.jiw-legend-sup {
  font-family: 'Noto Sans JP', sans-serif;
  font-size: 10px;
  font-weight: 400;
  color: #888;
}

/* 注釈（下に固定・左寄せ） */
.jiw-notes {
  font-size: 11px;
  color: #888;
  line-height: 1.9;
  white-space: pre-line;
  text-align: left;
  margin-top: 1rem;
}

/* --------------------------------------------------
   サブグラフ（白背景・罫線なし・見出しinline）
   PC: 370px固定
-------------------------------------------------- */
.jiw-slider-wrap {
  padding: 0 1.5rem;
  box-sizing: border-box;
}

.jiw-sub-card {
  background: #fff !important;
  border: none !important;
  padding: 0.75rem 1.5rem 0.5rem !important;
  box-sizing: border-box;
  width: 370px !important;
  flex: 0 0 370px !important;
}

/* 見出し：テキスト幅＋左右パディングのみ */
.jiw-sub-title {
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  background: #000;
  display: inline-block;
  padding: 4px 18px;
  margin-bottom: 0.5rem;
  white-space: nowrap;
}

/* --------------------------------------------------
   レスポンシブ
-------------------------------------------------- */
@media (max-width: 768px) {
  .jiw-summary-inner {
    flex-direction: column;
    gap: 1.5rem;
  }

  /* 累積点検実績数ヘッダーをセンタリング */
  .jiw-summary-header {
    text-align: center !important;
    width: 100%;
  }

  .jiw-summary-left {
    align-items: center;
  }

  .jiw-total {
    text-align: center;
    width: 100%;
  }

  /* 凡例は左寄せのまま・幅合わせ */
  .jiw-legend {
    width: 100%;
  }

  .jiw-notes {
    width: 100%;
  }

  .jiw-total .num {
    font-size: 72px;
  }

  .jiw-total .unit {
    font-size: 24px;
  }

  /* スライダー：次のカードが見えるよう300px幅 */
  .jiw-slider-wrap {
    overflow-x: scroll;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x mandatory;
    display: flex;
    gap: 0;
    padding-bottom: 0.5rem;
    /* 親のpaddingを無効化してフル幅に */
    margin-left: -1.5rem;
    margin-right: -1.5rem;
    padding-left: 1.5rem;
    padding-right: 1.5rem;
  }

  .jiw-slider-wrap::-webkit-scrollbar {
    height: 3px;
  }

  .jiw-slider-wrap::-webkit-scrollbar-thumb {
    background: #004077;
    border-radius: 2px;
  }

  /* 300px幅＋右に次のカードが少し見える */
  .jiw-sub-card {
    scroll-snap-align: start;
    width: 300px !important;
    flex: 0 0 300px !important;
    margin: 0 12px 0 0 !important;
  }

  .jiw-sub-card:last-child {
    margin-right: 1rem !important;
  }

  /* SP時：Y軸・X軸フォントを縮小 */
  .jiw-sub-card canvas {
    font-size: 9px;
  }
}


@media (min-width: 769px) and (max-width: 1024px) {
  .jiw-root {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  .jiw-summary-inner {
    gap: 1.5rem;
  }

  .jiw-summary-left {
    min-width: 180px;
  }

  .jiw-total .num {
    font-size: 72px;
  }

  .jiw-total .unit {
    font-size: 26px;
  }
}