.hamburger-menu,
.contact-info-mobile,
.sp-toggle,
.menu-overlay {
    display: none
}

/* Mobile guard: prevent root min-width from causing horizontal scroll */
@media screen and (max-width: 480px) {
    html, body {
        min-width: 0 !important;
        width: auto !important;
    }
}

.menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 9999;
    cursor: pointer
}

.menu-overlay.active {
    display: block
}

@media screen and (max-width: 1600px) {
    .recruit_page .entry-section .line_area{
        position: relative;
        transform: translate(0,0);
        text-align: center;
        padding-bottom: 100px;
    }
}

@media screen and (max-width: 991px) {
    /* Ensure header never widens viewport on mobile */
    header,
    header .header-container {
        width: 100% !important;
        max-width: 100% !important;
        overflow-x: hidden;
    }
    .hamburger-menu {
        display: block;
        width: 30px;
        height: 24px;
        position: fixed;
        top: 30px;
        right: 20px;
        cursor: pointer;
        z-index: 10001;
        pointer-events: auto !important
    }

    .hamburger-menu span {
        display: block;
        width: 100%;
        height: 2px;
        background-color: #091E9B;
        position: absolute;
        transition: all 0.3s
    }

    .hamburger-menu span:nth-child(1) {
        top: 0
    }

    .hamburger-menu span:nth-child(2) {
        top: 50%;
        transform: translateY(-50%)
    }

    .hamburger-menu span:nth-child(3) {
        bottom: 0
    }

    .hamburger-menu.active span:nth-child(1) {
        top: 50%;
        transform: translateY(-50%) rotate(45deg)
    }

    .hamburger-menu.active span:nth-child(2) {
        opacity: 0
    }

    .hamburger-menu.active span:nth-child(3) {
        bottom: 50%;
        transform: translateY(50%) rotate(-45deg)
    }

    .toppage .hamburger-menu span {
        background-color: #fff
    }

    .toppage .hamburger-menu.active span {
        background-color: #091E9B
    }

    .toppage .header-container.scrolled .hamburger-menu span {
        background-color: #fff
    }

    /* スクロール時でもアクティブ（×）は青で明瞭に */
    .toppage .header-container.scrolled .hamburger-menu.active span {
        background-color: #091E9B;
    }

    header .header-container {
        padding: 15px 20px;
        position: relative
    }

    header .header-container .logoarea {
        padding-left: 0;
        align-items: center
    }

    header .header-container .logo {
        height: 40px
    }

    header .header-container .la_txt {
        font-size: 12px
    }

    /* override desktop width:800px with equal/higher specificity */
    header .header-container .header-right,
    .header-right {
        display: block;
        position: fixed;
        top: 0;
        right: 0; /* keep anchored to viewport right */
        width: 80% !important; /* style.css sets width:800px with higher specificity */
        max-width: 300px;
        height: 100vh;
        background: #fff;
        z-index: 10000;
        overflow-y: auto;
        /* Use transform for off-canvas to avoid expanding layout width */
        transform: translateX(100%);
        transition: transform 0.3s ease;
        box-shadow: -5px 0 15px rgba(0, 0, 0, 0.2);
        padding: 80px 0 30px;
        pointer-events: auto !important
    }

    /* specificityを上げて off-canvas を確実に表示 */
    header .header-container .header-right.active,
    .header-right.active {
        transform: translateX(0)
    }

    .menu-overlay.active {
        display: block
    }

    header .header-container .header-right nav {
        width: 100%;
        max-width: 100%;
        padding: 0
    }


    header .header-container .header-right nav ul {
        display: block;
        padding: 0;
        gap: 0
    }

    header .header-container .header-right nav li {
        border-bottom: 1px solid #E9EFF4;
        position: relative
    }

    header .header-container .header-right nav a {
        display: block;
        color: #091E9B !important;
        padding: 15px 20px;
        font-weight: bold;
        pointer-events: auto !important
    }

    .sp-toggle {
        display: block;
        width: 50px;
        height: 50px;
        position: absolute;
        right: 0;
        top: 0;
        cursor: pointer;
        z-index: 10 !important;
        pointer-events: auto !important
    }

    .has-submenu>a {
        width: calc(100% - 60px) !important;
        display: inline-block !important;
        position: relative;
        z-index: 1
    }

    .sp-toggle::before {
        content: "+";
        font-size: 24px;
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        color: #091E9B
    }

    .sp-toggle.active::before {
        content: "-"
    }

    header .header-container .header-right nav .submenu {
        display: none;
        position: static;
        visibility: visible;
        opacity: 1;
        width: 100%;
        background: #f5f8fc;
        border-radius: 0;
        border: none;
        box-shadow: none;
        transition: none;
        pointer-events: auto !important
    }

    header .header-container .header-right nav .submenu.active {
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important
    }

    header .header-container .header-right nav .submenu li {
        border-bottom: none;
        padding: 0
    }

    header .header-container .header-right nav .submenu li a {
        padding: 10px 20px 10px 40px;
        font-weight: normal
    }

    .header-container .contact-info {
        border: none !important;
        padding: 20px;
        justify-content: center;
        width: 100%
    }

    .header-container .contact-info img {
        height: 30px
    }

    header .header-container .header-right .contact-info {
        display: none
    }

    .contact-info-mobile {
        display: block;
        position: fixed;
        top: 20px;
        right: 60px;
        z-index: 11
    }

    .contact-info-mobile img {
        height: 40px;
        filter: none !important
    }

    .desktop-tel {
        display: none
    }

    body.menu-active {
        overflow: hidden !important
    }

    .subpage section.hero-section div.hero-text h1 {
        font-size: 40px
    }

    .subpage section.hero-section div.hero-text p.h1-sub {
        font-size: 16px
    }

    .toppage .hero-section {
        padding-left: 0;
        height: 80vh
    }

    .toppage .hero-section .hero-bg img {
        height: 80vh;
        object-fit: cover
    }

    .toppage .hero-section .hero-text {
        left: 50%;
        top: 45%;
        transform: translate(-50%, -50%)
    }

    .toppage .hero-section .power-text {
        left: 0
    }

    .toppage .hero-section .scroll-icon {
        left: 50%
    }

    .toppage section.about-us-section div.wrap div.top-line {
        padding: 50px 20px;
        flex-direction: column
    }

    .toppage section.about-us-section div.wrap div.top-line div.text {
        width: 100%;
        padding: 30px 0
    }

    .toppage section.about-us-section div.wrap div.top-line div.text h3.oomidashi {
        font-size: 28px;
        margin-bottom: 30px
    }

    .toppage section.about-us-section div.wrap div.top-line div.thumb {
        width: 100%;
        text-align: center
    }

    .toppage section.service-section div.wrap div.list a.box {
        width: 100%
    }

    .toppage section.company-section div.wrap {
        padding: 80px 20px 50px
    }

    .toppage section.company-section div.wrap div.banner-area {
        padding: 30px
    }

    .toppage section.company-section div.wrap div.works-area {
        margin: 50px 0 0;
        padding: 30px 20px;
        flex-direction: column
    }

    .toppage section.company-section div.wrap div.works-area div.title-area {
        width: 100%;
        margin-bottom: 30px
    }

    .toppage section.company-section div.wrap div.works-area div.thumb-area div.fld {
        flex-wrap: wrap
    }

    .toppage section.company-section div.wrap div.works-area div.thumb-area div.fld div.box {
        width: 100%;
        margin-bottom: 20px
    }

    .toppage section.recruit-section div.wrap div.txt_area {
        width: 100%;
        text-align: center;
        padding: 30px 20px
    }

    .company_page .message-section .wrap {
        flex-direction: column
    }

    .company_page .message-section .txt_area {
        width: 100%
    }

    .company_page .message-section .thumb {
        width: 100%;
        text-align: center;
        padding-top: 30px
    }

    .company_page .information-section .map_area {
        flex-direction: column
    }

    .company_page .information-section .map_area .map {
        width: 100%;
        max-width: 100%
    }

    .company_page .information-section .map_area .company_img {
        width: 100%;
        max-width: 100%;
        margin-top: 20px
    }

    .service_page .label_area .under_line {
        width: 100px;
        left: -80px
    }

    .service_page .desc_area p {
        padding: 50px 0
    }

    .service_page section.monozukuri-section div.wrap div.txt_area {
        position: relative;
        right: auto;
        top: auto;
        transform: none;
        margin: 30px auto;
        padding: 30px 20px
    }

    .works_page .area .fld {
        gap: 20px
    }

    .works_page .area .fld .box {
        width: 100%;
        max-width: 100%
    }

    .recruit_page .staff-section .interview-header {
        flex-direction: column;
        padding: 60px 20px 20px
    }

    .recruit_page .staff-section .interview-info {
        width: 100%;
        padding-right: 0;
        margin-bottom: 20px
    }

    .recruit_page .staff-section .staff-photo {
        max-width: 100%
    }

    .recruit_page .staff-section .qa-list {
        padding: 0 20px
    }

    .recruit_page .event-section .event-photos .photo-row {
        flex-direction: column
    }

    .recruit_page .event-section .event-photos .photo-item {
        width: 100%;
        margin-bottom: 15px
    }

    .recruit_page .job-section .tab-content {
        padding: 40px 20px
    }

    .recruit_page .entry-section .entry-buttons {
        flex-direction: column
    }

    .recruit_page .entry-section .entry-buttons .tel-button,
    .recruit_page .entry-section .entry-buttons .mail-button {
        width: 100%;
        margin-bottom: 15px
    }

    .contact_page .form-group {
        flex-direction: column
    }

    .contact_page .form-group label {
        width: 100%;
        padding-bottom: 10px
    }

    .contact_page .form-group .input-area {
        width: 100%
    }

    .contact_page .required,
    .contact_page .optional {
        position: relative;
        right: auto;
        margin-left: 10px
    }

    footer .footer-container div.wrap div.topline {
        flex-direction: column;
        padding: 40px 0
    }

    footer .footer-container div.wrap div.topline div.txt {
        width: 100%;
        padding-right: 0;
        margin-bottom: 30px;
        text-align: center
    }

    footer .footer-container div.wrap div.topline div.banner {
        width: 100%;
        justify-content: center
    }

    footer .footer-container div.wrap div.bottomline {
        flex-direction: column;
        padding: 40px 0
    }

    footer .footer-container div.wrap div.bottomline div.banner {
        width: 100%;
        justify-content: center;
        margin-bottom: 30px
    }

    footer .footer-container div.wrap div.bottomline div.menu {
        width: 100%;
        flex-wrap: wrap
    }

    footer .footer-container div.wrap div.bottomline div.menu div.box {
        width: 50%;
        margin-bottom: 20px
    }

    .works_page .area .fld {
        justify-content: space-between
    }

    .works_page .area .fld .box {
        text-align: center;
        margin-bottom: 40px
    }

    .recruit_page .staff-section .interview-header::after {
        display: none
    }

    .recruit_page .staff-section .interview-header::before {
        top: 30px;
        left: 20px
    }

    .subpage .wrap {
        padding: 20px
    }

    section.kanren-section div.wrap {
        padding: 30px 10px 30px 10px
    }

    .toppage section.company-section div.wrap {
        padding: 100px 30px
    }

    .toppage section.company-section div.wrap div.works-area div.thumb-area div.fld div.box {
        width: 30%
    }

    .toppage .hero-section .power-text img {
        max-width: 150%
    }

    .toppage section.recruit-section div.wrap {
        position: relative
    }

    .toppage section.recruit-section div.wrap div.txt_area {
        color: #000
    }
}

@media screen and (min-width: 768px) and (max-width: 991px) {
    .toppage section.service-section div.wrap div.list a.box {
        width: 50%
    }

    .works_page .area .fld .box {
        width: 45%
    }

    .company_page .message-section .wrap {
        flex-direction: row
    }

    .company_page .message-section .txt_area {
        width: 60%
    }

    .company_page .message-section .thumb {
        width: 35%
    }

    .company_page .information-section .map_area {
        flex-direction: row
    }

    .recruit_page .staff-section .interview-header {
        flex-direction: row;
        padding: 60px 40px
    }

    .recruit_page .staff-section .interview-info {
        width: 40%;
        padding-right: 30px;
        margin-bottom: 0
    }

    .recruit_page .event-section .event-photos .photo-row {
        flex-direction: row
    }

    .recruit_page .event-section .event-photos .photo-item {
        width: 32%;
        margin-bottom: 0
    }

    .recruit_page .entry-section .entry-buttons {
        flex-direction: row
    }

    .recruit_page .entry-section .entry-buttons .tel-button,
    .recruit_page .entry-section .entry-buttons .mail-button {
        width: 48%;
        margin-bottom: 0
    }
}

@media screen and (min-width: 992px) {
    header .header-container .header-right {
        display: flex;
        position: static;
        width: 800px;
        height: auto;
        max-width: 800px;
        background: transparent;
        box-shadow: none;
        overflow: visible;
        padding: 0
    }
    /* 追加のクローズボタンは使用しないため無し */

    header .header-container .header-right nav {
        padding: 30px
    }

    header .header-container .header-right nav ul {
        display: flex;
        align-items: center;
        gap: 40px
    }

    .subpage .contact-info {
        border: 1px solid #091E9B
    }

    header .header-container .header-right nav li:hover .submenu {
        display: block;
        visibility: visible;
        opacity: 1
    }
}

/* 1000px以下で「電気工事」(03)のイラストがマークに被らないように調整 */
@media screen and (max-width: 1000px) {
    /* 1000px以下では 03_illust を非表示にする */
    .service_page section.denki-section div.wrap div.content .mark_area img.illust {
        display: none !important;
    }
}

@media screen and (max-width: 767px) {
    h2.title {
        font-size: 32px
    }

    footer .footer-container div.wrap div.bottomline div.menu div.box {
        width: 100%
    }

    .service_page .content h3 {
        font-size: 18px;
        max-width: 90%
    }

    .service_page .content .sample_list ul {
        font-size: 16px
    }

    .toppage section.about-us-section div.bottom-line img {
        max-width: 200%;
        width: 200%;
        position: relative;
        left: 50%;
        transform: translateX(-50%);
        display: block
    }

    /* スマホ表示時、SVG（object）を左右50px見切れるように拡大 */
    .toppage section.about-us-section div.bottom-line object.animated-svg {
        width: calc(100% + 200px);
        max-width: none;
        height: auto;
        position: relative;
        left: 50%;
        transform: translate(-50%, 10px);
        display: block;
    }

    .toppage section.company-section div.wrap div.works-area {
        background-color: rgba(255, 255, 255, 0.5)
    }
}

@media screen and (max-width: 600px) {
    .subpage section.hero-section div.hero-text h1 {
        font-size: 32px
    }

    .subpage section.hero-section div.hero-text p.h1-sub {
        font-size: 14px
    }

    .toppage .hero-section .power-text img {
        max-width: 200%
    }

    .toppage section.about-us-section div.bottom-line {
        overflow: hidden;
        position: relative
    }

    .toppage section.service-section div.wrap {
        padding: 150px 10px
    }

    .contact-info-mobile {
        display: none
    }

    .toppage section.service-section div.wrap div.list a.box {
        margin-bottom: 20px
    }

    .toppage section.company-section div.wrap div.works-area {
        padding: 40px 20px
    }

    .toppage section.company-section div.wrap div.works-area div.thumb-area div.fld {
        text-align: center
    }

    .toppage section.company-section div.wrap div.works-area div.thumb-area div.fld div.box {
        text-align: center
    }

    .toppage section.company-section div.wrap div.works-area div.thumb-area div.fld div.box a {
        text-align: center
    }

    .toppage section.recruit-section div.wrap div.txt_area p.desc {
        color: #000
    }

    .toppage section.recruit-section .recruit_banner img {
        width: 100%
    }

    .toppage section.recruit-section div.wrap {
        position: relative
    }

    .toppage section.recruit-section div.wrap div.txt_area {
        color: #000
    }

    .toppage section.recruit-section div.wrap div.txt_area p.sub-title {
        margin-bottom: 10px
    }

    .toppage section.recruit-section .sq {
        display: none
    }

    section.kanren-section div.wrap {
        padding: 20px 10px
    }

    section.kanren-section {
        margin: 50px 0
    }

    footer .footer-container {
        padding: 50px 2%
    }

    footer .footer-container div.wrap div.topline div.banner .tel {
        margin: 0 10px 0 0
    }

    footer .footer-container div.wrap div.bottomline div.banner {
        display: block
    }

    footer .footer-container div.wrap div.bottomline div.banner .logo {
        text-align: center;
        margin-bottom: 10px
    }

    footer .footer-container div.wrap div.bottomline div.banner .txt {
        text-align: center
    }

    footer .footer-container div.wrap div.bottomline div.banner div.txt {
        padding-left: 0px
    }

    footer .footer-container div.wrap div.bottomline div.menu {
        background-color: #5687b3;
        padding: 30px;
        border-radius: 4px;
        box-shadow: 0px 0px 4px #000;
        border: 4px double #fff
    }

    footer .footer-container div.wrap div.bottomline div.menu div.box {
        margin-bottom: 0px
    }

    footer .footer-container div.wrap div.bottomline div.menu div.box ul {
        font-size: 18px;
        padding: 10px 10px;
        margin: auto;
        width: 100%;
        font-size: 14px
    }

    footer .footer-container div.wrap div.bottomline div.menu div.box ul li ul {
        padding-left: 30px;
        font-size: 13px
    }

    .subpage section.hero-section img {
        object-fit: cover;
        object-position: center;
        display: block;
        margin: 0 auto;
        height: 200px
    }

    .subpage .wrap {
        padding: 30px 10px
    }

    table th,
    table td {
        display: block;
        padding: 5px 0
    }

    table th {
        border: none !important
    }

    .hide_td {
        display: none;
        padding: 0px
    }

    .view_td {
        padding: 0 0 20px 0 !important
    }

    .service_page .desc_area {
        background-position: left top !important;
        background-size: 50px 50px !important;
        padding: 50px 0px 10px 0px !important;
        margin: 30px 10px 10px 10px !important
    }

    .service_page .desc_area p {
        padding: 0px
    }

    .service_page .label_area .under_line {
        left: -50px
    }

    .service_page .content .sample_list {
        margin: 50px auto
    }

    .service_page .content {
        margin-bottom: 00px
    }

    .service_page .content h3 {
        margin-bottom: 20px
    }

    .service_page section.monozukuri-section div.wrap {
        padding: 30px
    }

    .service_page section.monozukuri-section div.wrap div.txt_area {
        padding: 30px;
        font-size: 15px
    }

    .works_page .area .fld .box {
        display: block;
        text-align: center;
        margin-bottom: 50px
    }

    .toppage section.company-section div.wrap div.works-area div.thumb-area div.fld div.box {
        width: 100%
    }
}

@media screen and (max-width: 768px) {
    .thanks_page .thanks-message-section {
        padding: 40px 0 80px
    }

    .thanks_page .thanks-message-section .message-box {
        padding: 30px 20px
    }

    .thanks_page .thanks-message-section .message-box h2 {
        font-size: 24px
    }

    .thanks_page .thanks-message-section .message-box .thanks-text {
        font-size: 16px
    }

    .thanks_page .thanks-message-section .message-box .notice-text {
        font-size: 13px;
        padding: 15px
    }

    .thanks_page .thanks-message-section .message-box .thanks-icon img {
        width: 60px;
        height: 60px
    }
}

@media screen and (max-width: 480px) {
    .thanks_page .thanks-message-section .message-box h2 {
        font-size: 20px
    }

    .thanks_page .thanks-message-section .message-box .thanks-text {
        font-size: 15px
    }

    .thanks_page .thanks-message-section .message-box .notice-text br {
        display: none
    }

    .thanks_page .thanks-message-section .message-box .button-area .btn-primary {
        padding: 12px 30px;
        font-size: 14px
    }

    .service_page .content .desc{
        margin-bottom: 100px;
    }
}
