#message {
    scroll-margin-top: 10rem;
    @media screen and (max-width: 767px) {
        scroll-margin-top: 7rem;
    }
    & h2 {
        margin: 10rem 0 5rem;
    }

    .message-container {
        box-sizing: border-box;
        width: 100%;
        border: 1px solid #FFFFFF;
        padding: 4.8rem 9.5rem 4.7rem 9.5rem;
        margin-bottom: 14rem;

        @media screen and (max-width: 767px) {
            padding: 3rem 1.5rem;
            margin-bottom: 6rem;
        }

        .msg-title {
            font-style: normal;
            font-weight: 700;
            font-size: 2.4rem;
            line-height: 160%;
            letter-spacing: 0.08em;
            font-feature-settings: 'palt' on;
            color: #E0B91C;
            margin-bottom: 2.3rem;

            @media screen and (max-width: 767px) {
                font-size: 1.8rem;
                margin-bottom: 2rem;
            }
        }

        .msg-txt {
            max-width: 101rem;
            font-style: normal;
            font-weight: 500;
            font-size: 1.6rem;
            line-height: 180%;
            letter-spacing: 0.08em;
            font-feature-settings: 'palt' on;
            color: #FFFFFF;
            margin-bottom: 0.7rem;

            @media screen and (max-width: 767px) {
                font-size: 1.4rem;
                margin-bottom: 1.5rem;
            }
        }

        .msg-name {
            font-style: normal;
            font-weight: 500;
            font-size: 1.6rem;
            line-height: 180%;
            text-align: right;
            letter-spacing: 0.08em;
            font-feature-settings: 'palt' on;
            color: #FFFFFF;

            @media screen and (max-width: 767px) {
                font-size: 1.2rem;
            }

            & span {
                font-size: 1.8rem;
                @media screen and (max-width: 767px) {
                    font-size: 1.4rem;
                }
            }
        }
    }
}

#profile {
    .profile-table-container {
        margin: 6.5rem 0 14rem;

        @media screen and (max-width: 767px) {
            margin: 4rem 0 6rem;
        }

        .profile-tb-row {
            display: flex;

            @media screen and (max-width: 767px) {
                flex-direction: column;
            }

            .tb-hd {
                box-sizing: border-box;
                display: flex;
                flex-direction: row;
                justify-content: center;
                align-items: center;
                padding: 1.6rem 0;
                width: 27.1rem;
                background: #E0B91C;
                border-bottom: 1px solid #FFFFFF;
                font-style: normal;
                font-weight: 700;
                font-size: 1.8rem;
                /* line-height: 18px; */
                text-align: center;
                letter-spacing: 0.08em;
                color: #073277;

                @media screen and (max-width: 767px) {
                    width: 100%;
                    padding: 1rem 0;
                }
            }

            .tb-txt {
                box-sizing: border-box;
                padding: 1.7rem 4rem;
                background: #F0F0F0;
                border-bottom: 1px solid #939393;
                font-style: normal;
                font-weight: 400;
                font-size: 1.6rem;
                line-height: 2.6rem;
                letter-spacing: 0.08em;
                color: #000000;
                width: 100%;

                @media screen and (max-width: 767px) {
                    padding: 1rem 1.5rem;
                }
            }
        }
    }
}

#history {
    .history-table-container {
        margin: 6rem 0 14rem;

        @media screen and (max-width: 767px) {
            margin: 4rem 0 6rem;
        }

        .history-row-table {
            border-bottom: 1px solid #FFFFFF;
            padding-bottom: 3.6rem;
            margin-bottom: 3.6rem;
            display: flex;
            gap: 7.4rem;

            font-style: normal;
            font-weight: 600;
            font-size: 1.8rem;
            line-height: 160%;
            letter-spacing: 0.08em;
            font-feature-settings: 'palt' on;
            color: #FFFFFF;

            .history-date {
                width: 12rem;
                @media screen and (max-width: 767px) {
                    width: inherit;
                }
            }

            @media screen and (max-width: 767px) {
                padding-bottom: 1rem;
                margin-bottom: 2rem;
                display: flex;
                gap: 0.5rem;
                font-style: normal;
                font-weight: 700;
                font-size: 1.5rem;
                flex-direction: column;
            }
        }
    }
}

#machinery {
    scroll-margin-top: 10rem;
    @media screen and (max-width: 767px) {
        scroll-margin-top: 7rem;
    }
    .machinery-mega-container {
        display: flex;
        flex-direction: column;
        gap: 3rem;
        margin: 6rem 0 15rem;

        @media screen and (max-width: 767px) {
            margin: 4rem 0 6rem;
        }

        /* ── Accordion block ── */
        .machinery-accordion {
            display: flex;
            flex-direction: column;
        }

        /* ── Title / trigger bar ── */
        .marchinery-title {
            font-style: normal;
            font-weight: 700;
            font-size: 2rem;
            letter-spacing: 0.08em;
            font-feature-settings: 'palt' on;
            color: #073277;
            width: 100%;
            min-height: 5.7rem;
            background: #E0B91C;
            border-radius: 0.8rem;
            position: relative;
            padding: 1.5rem 5rem 1.4rem 4rem;
            cursor: pointer;
            user-select: none;
            transition: border-radius 0.3s ease;
            display: flex;
            align-items: center;
            box-sizing: border-box;

            @media screen and (max-width: 767px) {
                font-size: 1.8rem;
                padding: 1rem 1rem 1rem 2rem;
                line-height: 2.7rem;
            }

            /* Arrow icon — points right (closed) */
            &::after {
                position: absolute;
                content: "";
                top: 0;
                bottom: 0;
                right: 2.4rem;
                margin: auto;
                width: 1rem;
                height: 1.8rem;
                background: url(../../common/img/blue-arrow.svg) no-repeat center;
                background-size: contain;
                transition: transform 0.3s ease;
            }

            /* Open state — arrow points up (rotated) */
            &.open {

                &::after {
                    transform: rotate(180deg);
                }
            }

            /* Closed state arrow points down */
            &:not(.open)::after {
                transform: rotate(0deg);
            }
        }

        /* ── Collapsible table wrapper ── */
        .machinery-table-wrapper {
            max-height: 0;
            overflow: hidden;
            transition: max-height 0.4s ease;

            @media screen and (max-width: 767px) {
                width: 100%;
                overflow: scroll;
                position: relative;
/* 
                &::before {
                    content: "←";
                    position: absolute;
                    left: 2rem;
                    bottom: 7rem;
                    animation: moveArrow 3s linear infinite;
                    font-size: 2rem;
                    color: #ddd;
                    border: 0.4rem solid #ddd;
                    border-radius: 50%;
                    width: 4rem;
                    height: 4rem;
                    display: flex;
                    align-items: center;
                    justify-content: center;
                    transition: opacity 0.5s ease-in-out;
                    opacity: 1;
                    pointer-events: none;
                    z-index: 10;
                } */
            }

            &.open {
                max-height: 200rem; /* large enough for any table */
            }
        }

        /* ── Inner table ── */
        .machinery-table {
            width: 100%;
            border-collapse: collapse;
            background: #FFFFFF;
            border-top: none;
            margin: 2.7rem 0;

            @media screen and (max-width: 767px) {
                width: max-content;
            }

            & thead tr {
                background: #76797E;

                & th {
                    color: #FFFFFF;
                    font-weight: 700;
                    font-size: 1.5rem;
                    letter-spacing: 0.06em;
                    padding: 1.2rem 2rem;
                    border-right: 1px solid #2a4d8a;
                    text-align: left;

                    @media screen and (max-width: 767px) {
                        font-size: 1.3rem;
                        padding: 2rem 1rem;
                    }

                    &:last-child {
                        border-right: none;
                    }

                    /* Column widths */
                    &:nth-child(1) {
                        width: 30.3rem;
                        border-right: 1px solid #E5E7EB;

                        @media screen and (max-width: 767px) {
                            width: 13.4rem;
                        }
                    }
                    &:nth-child(2) {
                        width: 40.1rem;
                        border-right: 1px solid #E5E7EB;
                        @media screen and (max-width: 767px) {
                            width: 11rem;
                        }
                    }
                    &:nth-child(3) {
                        width: 49.6rem;
                        @media screen and (max-width: 767px) {
                            width: 10rem;
                        }
                    }
                }
            }

            & tbody  tr {
                border-bottom: 1px solid #DDDDDD;

                &:last-child {
                    border-bottom: none;
                }

                & td {
                    letter-spacing: 0.04em;
                    padding: 2.2rem 1.6rem;
                    border-right: 1px solid #DDDDDD;
                    vertical-align: middle;
                    font-style: normal;
                    font-weight: 500;
                    font-size: 1.4rem;
                    /* line-height: 17px; */
                    text-align: center;
                    color: #000000;

                    @media screen and (max-width: 767px) {
                        font-size: 1.2rem;
                        padding: 2rem 0.5rem;
                    }

                    &:last-child {
                        border-right: none;
                    }

                    /* メーカー cell (first col) */
                    &:first-child {
                        font-weight: 500;
                        text-align: center;
                    }

                    /* 型式 cell (second col) */
                    &:nth-child(2) {
                        text-align: center;
                    }

                    /* 保有台数 cell (third col) */
                    &:nth-child(3) {
                        text-align: center;
                    }
                }

                &.second-tr {
                    & td {
                        background-color: #e5e7eb69;
                    }
                }
            }
        }
    }
}