.for-medical {
  position: relative;
  z-index: 0;
  background:
    url("../img/bg_overlay1.png") right top / 56.25rem auto no-repeat,
    url("../img/bg_overlay2.png") left top / 12.5rem auto no-repeat,
    url("../img/bg_base.png") center / cover no-repeat;
  min-height: 130vh;
  padding: 5rem 5vw 0;
  color: #fff;
  overflow-x: hidden;
  overflow-y: hidden; /* 縦スクロール禁止 */
}

@media (max-width: 430px) {
  .for-medical {
    padding: 0 3vw;
    /* レイヤー順はそのまま（overlay1 → overlay2 → base） */
    background-position:
      right -20%,
      left top 50rem,
      center top;
    background-size:
      175% auto,
      45% auto,
      100% auto; /* overlayをvwで小さく、baseは少し広め */
    background-repeat: repeat, no-repeat, repeat;
    padding-top: 2rem; /* 余白を戻して被りを和らげる */
    background-origin: padding-box; /* 余白内から描画 */
    background-clip: padding-box;
  }
}

.for-medical__title {
  position: absolute;
  top: 3%;
  left: 3%;
  transform: translateY(-10%);
  margin: 0;
  font-family: "Poiret One", sans-serif;
  font-size: 135px;
  font-weight: 300;
  letter-spacing: 0.1em;
  color: #53abe04d;
  line-height: 1;
  white-space: nowrap;
}

.for-medical__subtitle {
  text-align: center;
  margin: 0;
  font-family: "M PLUS 1p", sans-serif;
  font-size: 39px;
  font-weight: 400;
  color: #297fc1;
  white-space: nowrap;
  margin-top: 150px;
  margin-bottom: 50px;
}

.for-medical__subtitle-highlight {
  color: #53abe0;
}

.for-medical__subtitle-normal {
  color: #000;
}

.for-medical__points {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1rem;
  padding-bottom: 3rem;
}

.for-medical__point-card {
  flex: 1 1 10rem;
  max-width: 18.75rem;
  background-color: #67c0f6b3;
  border-radius: 2rem;
  text-align: center;
  padding: 0.8rem;
  box-shadow: 0 0.25rem 0.5rem rgb(0 0 0 / 5%);
  position: relative;
}

.for-medical__point-card--2,
.for-medical__point-card--4 {
  background-color: #a6f8e2b3;
}

.for-medical__point-title {
  margin: 0;
  font-family: "Poiret One", sans-serif;
  font-size: 60px;
  font-weight: 300;
  color: #fff;
  letter-spacing: 0.05em;
}

.for-medical__point-title-num1,
.for-medical__point-title-num3 {
  color: #d5ff13;
}

.for-medical__point-title-num2,
.for-medical__point-title-num4 {
  color: #67c0f6;
}

.d-none {
  display: none !important;
}

.for-medical__desc-text p {
  margin: 0 0 1.5rem;
}

@media (width <= 1050px) {
  .for-medical__desc-text p {
    margin-bottom: 0;
  }

  .d-sp-none {
    display: none !important;
  }

  .d-sp-block {
    display: block !important;
  }
}

@media (width <= 767px) {
  .for-medical__point-title-num1,
  .for-medical__point-title-num4 {
    color: #d5ff13;
  }

  .for-medical__point-title-num2,
  .for-medical__point-title-num3 {
    color: #67c0f6;
  }
}

.for-medical__point-img {
  margin: 0.5rem auto 0.25rem;
  height: 150px;
  width: auto;
}

.for-medical__point-desc {
  margin: 0.5rem 0 0;
  font-family: "M PLUS 1p", sans-serif;
  font-size: 19px;
  font-weight: 500;
  line-height: 1.4;
  text-align: center;
}

.for-medical__point-desc--black {
  color: #000;
}

.for-medical__point-desc--blue {
  color: #2e57bf;
}

.for-medical__point-desc--small-black {
  font-size: 0.625rem;
  color: #000;
}

.for-medical__point-desc--small-blue {
  font-size: 0.625rem;
  color: #2e57bf;
}

.for-medical__desc {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin: 2rem auto 0;
  width: 100%;
  max-width: 82.5rem;
  padding: 0 0.625rem;
}

.for-medical__desc-text {
  flex: 1;
  color: #333;
  font-family: "M PLUS 1p", sans-serif;
  font-size: 1.125rem;
  line-height: 1.75;
}

.for-medical__desc-text strong {
  color: #000;
  font-weight: 700;
}

.for-medical__desc-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 1.25rem;
  text-decoration: none;
  background: linear-gradient(135deg, #67c0f6 0%, #54ace1 100%);
  color: #fff;
  font-family: "M PLUS 1p", sans-serif;
  font-weight: 600;
  font-size: 19px;
  padding: 1.125rem 4.375rem;
  border-radius: 2.5rem;
  transition: background 0.2s;
}

.for-medical__desc-button-icon {
  width: 0.625rem;
  height: auto;
  display: inline-block;
}

.for-medical__desc-button:hover {
  background: linear-gradient(135deg, #54ace1 0%, #4398cb 100%);
}

.for-medical__desc-image {
  flex: 1;
  overflow: hidden;
  max-width: 37.5rem;
  position: relative;
  left: calc((98.5vw - 100%) / 2);
}

.for-medical__desc-image img {
  width: 100%;
  height: auto;
  display: block;
}

.for-medical__center-image {
  text-align: center;
  margin: 80px auto;
}

.for-medical__center-image img {
  max-width: 90%;
  height: auto;
  display: inline-block;
}

.for-medical__visit {
  width: 100vw;
  height: 450px;
  align-items: center;
  padding-top: 0.6rem;
  position: relative;
  z-index: 2;
  overflow: visible;
  margin-left: -5vw;
}

.for-medical__visit::before {
  position: absolute;
  background: url("../img/visit_illustration.jpg") no-repeat center center;
  background-size: cover;
  content: "";
  width: 44vw;
  height: 100%;
  left: 0;
  top: 0;
  display: block;
}

.for-medical__visit-image {
  flex: 1 1 48%;
  max-width: 48%;
  position: relative;
  left: calc((100% - 100vw) / 2);
}

.for-medical__visit-image img {
  width: 100%;
  height: auto;
  display: block;
}

.for-medical__visit-text {
  position: relative;
  width: 100%;
  color: #333;
  font-family: "M PLUS 1p", sans-serif;
  line-height: 1.6;
  margin-bottom: 80px;
  height: 100%;
}

.for-medical__visit-content {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  padding-left: 50vw;
  padding-right: 5vw;
  padding-bottom: 110px;
/*   width: 45vw; */
}

.for-medical__visit-title {
  margin: 0 0 1rem;
  font-size: 29px;
  font-weight: 500;
  color: #53abe0;
  white-space: nowrap;
}

.for-medical__visit-desc {
  margin: 0;
  font-size: 1.125rem;
  line-height: 1.75;
}

.for-medical__visit-desc strong {
  color: #000;
}

.for-medical__visit-section {
  display: none;
}

.for-medical__visit-section img {
  display: none;
}

@media (width > 430px) and (width <= 1020px) {
  .for-medical__desc {
    display: grid;
    grid-template-columns: 1fr;
    grid-template-areas:
      "text1"
      "image"
      "text2"
      "button";
    gap: 1rem;
  }

  .for-medical__desc-text {
    display: contents;
  }

  .for-medical__desc-text1 {
    grid-area: text1;
  }

  .for-medical__desc-image {
    grid-area: image;
    justify-self: center;
    max-width: none;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 0 auto;
    left: 1rem;
  }

  .for-medical__desc-image img {
    max-width: 90%;
    height: auto;
    display: block;
    margin: 0 auto;
  }

  .for-medical__desc-text2 {
    grid-area: text2;
  }

  .for-medical__desc-button {
    grid-area: button;
    justify-self: center;
    padding: 1.125rem 2rem;
  }

  .for-medical__center-image img {
    max-width: 99%;
    height: auto;
    display: inline-block;
  }

  .for-medical__visit {
    display: grid;
    grid-template-columns: 1fr;
    grid-template-areas:
      "title"
      "desc"
      "image";
    gap: 1rem;
  }

  .for-medical__visit-text {
    display: contents;
  }

  .for-medical__visit-title {
    grid-area: title;
    margin: 0 0 1rem;
    font-size: 1.2rem;
    font-weight: 700;
    color: #53abe0;
    white-space: wrap;
  }

  .for-medical__visit-desc {
    grid-area: desc;
    margin: 0;
    white-space: wrap;
  }

  .for-medical__visit-image {
    grid-area: image;
    display: flex;
    justify-content: center;
    align-items: center;
    max-width: 100%;
    width: 100%;
    position: static;
    left: 0;
    transform: none;
  }

  .for-medical__visit-image img {
    max-width: 90%;
    height: auto;
    display: block;
    margin: 0 auto;
  }
}

@media (width >430px) and (width <= 930px) {
  .for-medical__title {
    position: static;
    left: auto;
    top: auto;
    transform: none;
    text-align: center;
    margin: 1.5rem 0 0;
    font-size: clamp(3rem, 12vw, 6rem);
    white-space: wrap;
  }

  .for-medical__subtitle {
    margin-top: clamp(4rem, 13vw, 7rem);
  }

  .for-medical__point-title {
    font-size: 2rem;
  }

  .for-medical__point-img {
    height: 4rem;
  }

  .for-medical__point-desc {
    font-size: 0.8rem;
  }
}

@media (width > 430px) and (width <= 720px) {
  .for-medical__subtitle {
    position: static;
    left: auto;
    top: auto;
    transform: none;
    text-align: center;
    margin: 0.5rem 0 0;
    font-size: clamp(0.9rem, 4vw, 1.5rem);
    white-space: wrap;
  }

  .for-medical__points {
    margin-top: 3rem;
  }
}

/* For client data section */
.container {
  background: #54ace166;
  border-radius: 40px;
  padding: 10px;
  max-width: 82.5rem;
  width: 100%;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
  margin-top: 50px;
  margin-right: auto;
  margin-left: auto;
  margin-bottom: 50px;
}

.content-wrapper {
  border-radius: 35px;
  padding: 50px 60px 10px;
  position: relative;
  min-height: 450px;
}

.header {
  margin-bottom: 60px;
}

.main-title {
  font-size: 87px;
  color: white;
  font-weight: 200;
  letter-spacing: 0.15em;
  margin-bottom: 5px;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.sub-title {
  font-size: 29px;
  color: white;
  font-weight: 300;
  letter-spacing: 0.05em;
  opacity: 0.95;
}

.main-content {
  display: flex;
  align-items: center;
  gap: 60px;
}

.charts-wrapper {
  display: flex;
  gap: 50px;
}

.chart-container {
  text-align: center;
  position: relative;
}

.chart-box {
  width: 250px;
  height: 250px;
  position: relative;
}

.chart-legend {
  position: absolute;
  font-size: 18px;
  font-weight: 500;
  color: #07297f;
  white-space: nowrap;
}

/* 医科・歯科の凡例位置 */
.medical-legend {
  top: 60px;
  left: 30px;
}

.dental-legend {
  bottom: 60px;
  right: 25px;
}

/* エリアの凡例位置 */
.outside-legend {
  top: 45px;
  left: 15px;
}

.inside-legend {
  bottom: 45px;
  right: 5px;
}

.chart-label {
  font-size: 20px;
  color: #3153ad;
  font-weight: 500;
  margin-top: 15px;
}

.percentage-section {
  flex: 1;
  text-align: center;
  padding-left: 40px;
  padding-right: 190px;
}

.percentage-wrapper {
  display: inline-flex;
  align-items: baseline;
  margin-bottom: 15px;
}

.percentage-number {
  font-family: "M PLUS 1p", sans-serif;
  font-size: 117px;
  color: white;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.02em;
}

.percentage-symbol {
  font-family: "M PLUS 1p", sans-serif;
  font-size: 50px;
  color: white;
  font-weight: 200;
  margin-left: 5px;
  align-self: flex-start;
  margin-top: 25px;
}

.percentage-label {
  font-size: 20px;
  color: #3153ad;
  font-weight: 500;
  line-height: 1.4;
}

.note {
  position: absolute;
  bottom: 5px;
  left: 60px;
  font-size: 9px;
  color: #ffffff;
  letter-spacing: 0.02em;
}

.illustration {
  position: absolute;
  bottom: 0;
  right: 50px;
  width: 240px;
  height: 300px;
  background: url("../img/client_data_human.png") no-repeat center;
  background-size: contain;
}

@media (width > 1200px) and (width <= 1400px) {
  .illustration {
    bottom: -50px;
  }
  .percentage-section {
    padding-bottom: 100px;
  }
}

@media (width > 1200px) and (width <= 1300px) {
  .illustration {
    width: 160px;
    height: 200px;
  }
}

@media (max-width: 1200px) {
  .main-content {
    flex-direction: column;
    align-items: center;
    gap: 20px;
  }
}

@media (max-width: 1100px) {
  .for-client__header {
    flex-direction: column;
    align-items: center;
    gap: 20px;
  }
}

@media (max-width: 950px) {
  .illustration {
    width: 160px;
    height: 200px;
  }
}

canvas {
  max-width: 100%;
  height: auto !important;
}

.for-client__title {
  margin: 0;
  font-family: "Poiret One", sans-serif;
  font-size: 90px;
  font-weight: 300;
  letter-spacing: 0.1em;
  color: #ffffffcc;
  line-height: 1;
  white-space: nowrap;
}

.for-client__header {
  display: flex;
  align-items: baseline;
  justify-content: flex-start;
  margin-bottom: 2rem;
}

.for-client__title {
  font-family: "Poiret One", sans-serif;
  font-size: 90px;
  font-weight: 300;
  color: #ffffff;
  letter-spacing: 0.1em;
  white-space: nowrap;
  margin: 0;
  text-align: left;
  opacity: 0.8;
}

.for-client__subtitle {
  font-family: "M PLUS 1p", sans-serif;
  font-size: 29px;
  font-weight: 400;
  color: #fff;
  white-space: nowrap;
  margin: 0 0 0 1rem;
  text-align: left;
}

@media (width <= 700px) {
  .for-medical__title {
    top: 1%;
    font-size: 50px;
    align-self: center;
  }

  .for-medical__subtitle {
    top: 1.8%;
    font-size: 21px;
    left: 40%;
    margin-top: clamp(4rem, 13vw, 7rem);
    text-align: left;
    margin-bottom: 25px;
  }

  .for-medical__points {
    display: grid;
    grid-template-columns: repeat(2, 1fr); /* 2列 */
    gap: 0.8rem; /* 余白 */
    justify-items: center; /* 各セル内のカードを中央寄せ */
    margin: 0;
    padding-bottom: 0rem;
  }

  /* カード内のレイアウトを中央寄せ（縦横）に */
  .for-medical__point-card--1,
  .for-medical__point-card--2,
  .for-medical__point-card--3,
  .for-medical__point-card--4 {
    display: flex; /* 中身をFlexで中央寄せ */
    flex-direction: column; /* タイトル→画像→説明の縦並びを想定 */
    align-items: center; /* 横中央 */
    justify-content: center; /* 縦中央 */
    gap: 0rem; /* 要素間の隙間 */
    overflow: hidden; /* はみ出し抑止 */
    max-width: 85%; /* カードの最大幅を100%に */
    width: 85%; /* カードの幅を100%に */
    aspect-ratio: 1 / 1.3;
    padding-top: 1rem;
  }

  /* 画像をカード中心に収める（はみ出さず、できるだけ大きく） */
  .for-medical__point-img {
    max-width: 80%;
    max-height: 60%;
    width: auto;
    height: auto;
    object-fit: contain; /* 比率を保って内側にフィット */
    margin: 0 auto; /* 念のため中央寄せ */
  }

  .for-medical__point-title {
    font-size: 2.5rem;
    text-align: center;
    margin: 0;
    padding: 0 0.5rem; /* 横に少し余白を追加 */
  }

  .for-medical__point-desc {
    font-size: 11.5px;
    text-align: center;
    margin: 0;
    padding: 0 0.5rem; /* 横に少し余白を追加 */
  }

  /* 縦並びの基本：コンテナを縦方向に積む */
  .for-medical__desc {
    display: flex;
    flex-direction: column; /* 縦積み */
    align-items: center; /* ← 子要素を水平方向に中央寄せ */
    gap: 1.5rem; /* ブロック間の余白 */
    margin-right: 2rem;
    width: 100%;
    max-width: 82.5rem;
    padding: 0 0;
  }

  /* ラッパーを“透過”して中の要素を直接の子として扱う */
  .for-medical__desc-text {
    display: contents; /* ← これで text1 / text2 / ボタンを直下扱いに */
    text-align: left;
  }

  .for-medical__desc-text p {
    margin: 0;
  }

  /* 並び順：text1 → image → text2 → button */
  .for-medical__desc-text1 {
    order: 1;
  }
  .for-medical__desc-image {
    order: 2;
  }
  .for-medical__desc-text2 {
    order: 3;
  }

  .for-medical__desc-image {
    display: flex;
    justify-content: center;
    left: 0;
  }

  .for-medical__desc-button {
    order: 4;
    white-space: nowrap;
    align-self: center;
    padding: 1.125rem 10%;
  }

  .container {
    padding: 0px;
    border-radius: 20px;
    margin-bottom: 0;
  }
  .content-wrapper {
    padding: 30px 20px 140px;
    min-height: 300px;
  }

  .for-client__header {
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
  }

  .for-client__title {
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    font-size: 50px;
  }

  .for-client__subtitle {
    font-size: 18px;
    margin: 0;
  }

  .chart-container {
    text-align: center;
    position: relative;
    width: 40%;
    left: 2%;
  }

  .chart-box {
    width: 150px;
    height: 150px;
    position: relative;
  }

  .medical-legend {
    top: 28%;
    left: 8%;
    font-size: 13px;
  }

  .dental-legend {
    bottom: 11%;
    right: 18%;
    font-size: 13px;
  }

  .inside-legend {
    bottom: 4%;
    right: 26%;
    font-size: 13px;
    text-align: right;
  }

  .outside-legend {
    top: 19%;
    left: 8%;
    font-size: 13px;
    text-align: left;
  }

  .percentage-section {
    padding-left: 20%;
  }

  .percentage-number {
    font-size: 70px;
    margin-left: -13%;
  }

  .percentage-wrapper {
    margin-bottom: 2px;
  }

  .percentage-symbol {
    display: none;
  }

  .percentage-label {
    font-size: 16px;
    line-height: 1.4;
    margin-left: -15%;
  }

  .illustration {
    position: absolute;
    bottom: 0;
    top: 60%;
    right: 3%;
    height: 40%;
    opacity: 1;
  }

  .note {
    font-size: 15px;
    left: 7%;
    bottom: 3%;
  }

  .for-medical__point-card--1,
  .for-medical__point-card--4 {
    background-color: #67c0f6b3;
  }

  .for-medical__point-card--2,
  .for-medical__point-card--3 {
    background-color: #a6f8e2b3;
  }

  .for-medical__visit {
    display: grid;
    grid-template-columns: 1fr;
    grid-template-areas:
      "title"
      "desc"
      "image";
    gap: 1rem;
  }

  .for-medical__visit-content {
    position: static;
    transform: none;
    padding: 0;
    width: 100%;
    text-align: left;
  }

  .for-medical__visit-title {
    grid-area: title;
    font-size: 20px;
  }
  .for-medical__visit-desc {
    grid-area: desc;
    margin-bottom: 2rem;
  }
  .for-medical__visit-image {
    grid-area: image;
  }

  .for-medical__visit-illustration {
    width: 620px;
    height: 100%;
    z-index: 0; /* behind text */
  }

  .for-medical__visit-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }

  .for-medical__visit {
    display: none;
  }

  .for-medical__visit-section {
    display: flex;
    flex-direction: column; /* 縦に積む */
    align-items: center; /* 中央寄せ */
    gap: 1.5rem;
    width: 100%;
    max-width: 82.5rem;
    margin: 2rem auto 15%;
  }

  .for-medical__visit-section img {
    width: 100vw;
    max-width: none;
    height: auto;
    display: block;
    margin-left: -3vw; /* 親paddingぶんを打ち消す */
    align-items: flex-start;
  }

  .for-medical__desc-text {
    font-size: 16px;
  }

  .for-medical__visit-desc {
    font-size: 16px;
  }
}
