.simple-fv {
    text-align: center;
    line-height: 2.0;
    margin: 24rem 0;
}

.case-study .simple-fv h2 {
    margin-bottom: 8rem;
}

.case-study .simple-fv p {
    font-size: 2.5rem;
}

.case-study-wrap {
    width: 80%;
    height: auto;
    margin: 0 auto;
}

.case-study-wrap .flex-container {
    max-width: 150rem;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 440px));
    gap: 12rem 6.4rem;
    justify-content: space-around;
    justify-items: center;
    align-items: stretch;
} 

.case-study-box {
    margin: 0;
    min-width: 280px;
    max-width: 440px;
    width: 100%;
    display: block;
} 
.case-study .device-label p, .case-study .service-label p {
    font-size: 1.2rem;
    padding: 0.8rem 1.6rem;
}

.case-study-box:hover {
    opacity: 0.5;
    cursor: pointer;
}

/* タブ */
.case-study .wrap_in {
    width: 80%;
    margin: 0 auto;
}
.page-casestudy__tab {
    background-color: #fff;
    width: 90%;
    max-width: 150rem;
    border-radius: 8px;
    margin: 0 auto 12rem;
}

.page-casestudy__tab-list {
    display: flex;
    margin-bottom: 20px;
    }


.page-casestudy__tab-list-item {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
  /* 既存スタイルも保持 */
    flex: 1;
    text-align: center;
    padding: 15px 0;
    font-weight: bold;
    font-size: 20px;
    color: #999;
    border: none;
    background-color: #f8f8f8;
    cursor: pointer;
    transition: all 0.3s ease;
}

.page-casestudy__tab-list-item p {
    margin: 0;
    color: inherit; /* ボタンのcolorを引き継ぐ */
}

.page-casestudy__tab-list-item .icon-svg {
    width: 40px;
    height: 40px;
    color: #999; /* 通常時：アイコンもグレー */
    transition: color 0.3s ease;
}

.page-casestudy__tab-list-item.active {
    color: #000;
    box-shadow: inset 0 8px 0 0 #6285FC; /* ←内側の上線に見える */
    background-color: #fff;
}
.page-casestudy__tab-list-item.active .icon-svg {
    color: #6285FC; /* アクティブ時：アイコンは青 */
}

.page-casestudy__tab-content-item {
    display: none;
}

.page-casestudy__tab-content-item.show {
    display: block;
    padding: 4rem;
}

.page-casestudy__tab-content-item-list > li {
    list-style: none;
    width: 100%; /* グリッドにフィットさせる */
    max-width: 300px; /* ←ここがポイント！ */
    margin: 0 auto; /* 中央揃え（必要に応じて） */
}

.page-casestudy__tab-content-item-list {
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    justify-content: center;
    gap: 24px 32px;
}

.page-casestudy__tab-content-item-list-item-link {
    display: block;
    width: 100%;
    background-color: #f8f8f8;
    color: #000000;
    padding: 16px 0;
    text-align: center;
    border-radius: 30px;
    font-size: 16px;
    text-decoration: none;
    box-shadow: 0 2px 6px rgba(0,0,0,0.08);
    transition: all 0.2s ease;
}

.page-casestudy__tab-content-item-list-item-link.active {
    background-color: #90a8f8 /* アクティブ時の背景色 */
}

.device-label p:empty,
.service-label p:empty {
    background-color: #ffffff;
}




/* タブ */
@media screen and (max-width: 768px) {
.page-casestudy__tab-list-item .icon-svg {
    width: 20px;
    height: 20px;
}
.page-casestudy__tab-content-item-list {
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(70px, 1fr));
}
.page-casestudy__tab-list-item p {
    font-size: 12px;
}
.page-casestudy__tab-content-item-list-item-link {
    font-size: 10px;
    padding: 16px 0;
    border-radius: 10px;
}
.page-casestudy__tab-content-item.show {
    padding: 0 24px 16px;
}
}


@media screen and (max-width: 768px) {
.case-study-wrap .flex-container {
    gap: 4rem;
    justify-items: center;
}
.case-study .simple-fv {
    text-align: center;
    padding-top: 12rem;
}

.case-study .simple-fv h2 {
    margin-bottom: 2.4rem;
}

.case-study .simple-fv p {
    font-size: 1.4rem;
}
}