html {
    overflow-x: hidden;
    width: 100%;
    max-width: 100%;
}

* {
    box-sizing: border-box;
}

:root {
    --text-color: #666;
    --about-bg-color-solid: rgba(255, 0, 0, 0.08);
    --about-bg-color-transparent: rgba(255, 0, 0, 0);
    --user-text-color: #FF8C00;
    --heading-color: #E05D30;
    --bubble-bg-color: #FFFBF0;
    --oval-bg-color: #EBB599;
    --oval-text-color: #FFFDF5;
}

body {
    font-family: 'Zen Maru Gothic', 'Hiragino Kaku Gothic ProN', 'メイリオ', sans-serif;
    margin: 0;
    padding: 0;
    color: var(--text-color);
    background: url('background.svg') repeat;
    background-size: 50% auto;
    background-attachment: fixed;
    line-height: 1.6;
    overflow-x: hidden;
    position: relative;
    width: 100%;
}

.nav {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    padding: 0 15px;
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
    background-color: rgba(255, 253, 240, 0.95);
    box-shadow: none;
    height: 48px;
}

.hamburger-menu {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 30px;
    height: 22px;
    cursor: pointer;
    z-index: 1001;
    grid-column: 1;
    justify-self: start;
}

.hamburger-menu span {
    display: block;
    height: 3px;
    width: 100%;
    background-color: #FF8C00;
    border-radius: 3px;
    transition: all 0.3s ease;
}

.mobile-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: 30px;
    grid-column: 2;
    justify-self: center;
}

.nav-tel {
    grid-column: 3;
    justify-self: end;
    z-index: 1001; /* 確実に最前面に表示 */
}

.nav-tel a {
    display: inline-block;
    position: relative;
    z-index: 1002; /* リンクを最前面に */
}

.tel-icon {
    height: 40px;
    max-width: 250px;
    object-fit: contain;
    transition: transform 0.2s;
}

.nav-tel a:hover .tel-icon {
    transform: scale(1.05); /* ホバー時に少し拡大 */
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 5px;
    transition: transform 0.3s ease;
    text-decoration: none;
    color: #FF8C00;
    padding: 2px 0;
    margin-top: -2px;
    font-weight: bold;
}

.nav-item:hover {
    transform: scale(1.05);
}

.nav-icon {
    width: 36px;
    height: 36px;
    border-radius: 4px;
    position: relative;
    top: 0;
}

.container { 
    max-width: 1000px; 
    margin: auto; 
    padding: 20px; 
    margin-top: 10px;
    overflow-x: hidden;
    width: 100%;
}

.header-section {
    position: relative;
}

.header { 
    display: flex; 
    align-items: center; 
    justify-content: center;
    gap: 70px;
    min-height: 70vh;
    max-width: 1000px; 
    margin: auto;
    padding: 20px;
    position: relative;
    padding-top: 120px;
}

.station-name {
    width: 50%;
    max-width: 440px;
    z-index: 2;
}

.map-area {
    width: 40%;
    max-width: 396px;
    z-index: 2;
}

.svg-container {
    width: 100%;
    height: auto;
    pointer-events: none;
}

.business-hours {
    text-align: center;
    margin: 0 auto 50px auto;
    max-width: 800px;
    position: relative;
    top: -30px;
}

.business-hours img {
    width: 100%;
    max-width: 360px;
    height: auto;
}

.red-background-area {
    position: relative;
    width: 100%;
    padding: 60px 0;
    overflow-x: hidden;
}

.red-background-area::before {
    content: "";
    position: absolute;
    top: 0;
    left: -50vw;
    right: -50vw;
    width: 200vw;
    height: 100%;
    background: linear-gradient(
        to bottom,
        var(--about-bg-color-transparent) 0%,
        var(--about-bg-color-solid) 10%,
        var(--about-bg-color-solid) 90%,
        var(--about-bg-color-transparent) 100%
    );
    z-index: -1;
}

.content { 
    margin: 30px 0;
    text-align: left; 
    font-size: 1.1em; 
    line-height: 1.6; 
    padding: 25px;
    border-radius: 8px;
}

#about.content, #flow.content {
    background-color: transparent;
    box-shadow: none;
    padding-top: 40px;
    padding-bottom: 40px;
}

#flow.content {
    margin-top: 0;
}

#services.content {
    margin-bottom: 0;
    padding-bottom: 10px;
}

.content h2 {
    margin-top: 30px;
    margin-bottom: 40px;
    border-left: none;
    text-align: center;
    font-weight: bold;
    font-size: 1.8em;
    padding-left: 0;
    color: var(--heading-color);
}

#services.content h2 {
    margin-bottom: 80px;
}

#conclusion.content h2 {
    margin-top: 15px;
    margin-bottom: 30px;
}

#flow.content h2 {
    margin-bottom: 80px;
}

.conclusion-content {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 40px;
    width: 100%;
}

.conclusion-img-container {
    max-width: 800px;
    width: 100%;
    margin: 0 auto;
    text-align: center;
}

.conclusion-img {
    max-width: 100%;
    width: auto;
    height: auto;
    margin: 0 auto 20px;
}

/* イメージキャラクターのスタイル */
.mascot-container {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 40px auto 20px;
    width: 100%;
}

.mascot-img {
    width: 200px; /* 固定幅を指定 */
    height: auto;
    display: block;
}

@media (min-width: 1200px) {
    .conclusion-img {
        max-width: 80%;
        transform: scale(0.85);
        transform-origin: center center;
    }
}

.dialogue-container {
    display: flex;
    flex-direction: column;
    width: 100%;
    margin: 40px 0;
    gap: 0;
}

.dialogue {
    width: 100%;
    display: flex;
    justify-content: center;
}

.dialogue-user {
    align-items: flex-start;
    justify-content: flex-start;
    padding-left: 5%;
}

.dialogue-provider {
    align-items: flex-start;
    justify-content: flex-end;
    padding-right: 5%;
}

.dialogue-combined {
    width: 380px;
    height: auto;
    max-width: 90%;
    margin-bottom: 10px;
    box-sizing: border-box;
}

.dialogue-provider .dialogue-combined {
    width: 520px;
    max-width: 95%;
}

.clear-margin {
    clear: both;
    height: 40px;
    display: block;
    content: "";
}

.oval-container {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 20px;
    width: 80%;
    margin: 0 auto 40px auto;
    max-width: 600px;
}

.oval-wrapper {
    flex: 1;
    min-width: 220px;
    max-width: 300px;
    display: flex;
    justify-content: center;
}

.oval {
    background-color: var(--oval-bg-color);
    border-radius: 12px;
    padding: 15px 5px;
    text-align: center;
    color: var(--oval-text-color);
    font-weight: bold;
    width: 220px;
    min-height: 80px;
    line-height: 1.5;
    font-size: 1.1em;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
}

.oval p {
    margin: 0;
    padding: 0;
}

.image img { 
    width: 100%; 
    height: auto; 
    max-width: 600px;
    border-radius: 8px;
}

.flow-image {
    text-align: center;
}

.flow-image img {
    width: 100%;
    max-width: 500px;
    height: auto;
}

.section { 
    padding-top: 58px;
    scroll-margin-top: 58px;
}

#about.section, #services.section, #conclusion.section {
    padding-top: 10px;
    margin-top: 0;
}

.services {
    max-width: 900px;
    margin: 0 auto;
}

.services-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    justify-items: center;
}

.service-text {
    margin-bottom: 15px;
    text-align: left;
    max-width: 350px;
    width: 100%;
}

.service-text p {
    margin-bottom: 15px;
    font-weight: bold;
    text-align: center;
    padding-left: 0;
    word-break: keep-all;
    white-space: normal;
    line-height: 1.8;
}

.service-text p br {
    display: block;
    content: "";
    margin-top: 8px;
}

.service-text h3 {
    color: var(--user-text-color);
    margin-bottom: 10px;
    font-size: 1.3em;
    display: flex;
    align-items: center;
    justify-content: center;
    padding-bottom: 5px;
}

.service-icon {
    width: 36px;
    height: 36px;
    margin-right: 10px;
    object-fit: contain;
}

.description-spacer {
    height: 16px;
    display: block;
    width: 100%;
    clear: both;
}

.service-description-img {
    display: block;
    width: 100%;
    min-width: 280px;
    max-width: 350px;
    height: auto;
    margin: 0 auto 15px;
    text-align: center;
    transform: scale(1.15);
    transform-origin: center center;
}

@media (max-width: 1024px) {
    .nav {
        justify-content: space-between;
    }
    
    .hamburger-menu {
        display: flex;
    }
    
    .nav-menu {
        position: fixed;
        top: 0;
        left: -100%;
        width: 80%;
        max-width: 300px;
        height: 100%;
        background-color: rgba(255, 253, 240, 0.98);
        flex-direction: column;
        justify-content: flex-start;
        gap: 15px;
        padding: 70px 20px 20px;
        transition: left 0.3s ease;
        z-index: 1000;
        box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
    }
    
    .nav.active .hamburger-menu span:nth-child(1) {
        transform: translateY(9.5px) rotate(45deg);
    }
    
    .nav.active .hamburger-menu span:nth-child(2) {
        opacity: 0;
    }
    
    .nav.active .hamburger-menu span:nth-child(3) {
        transform: translateY(-9.5px) rotate(-45deg);
    }
    
    .nav.active .nav-menu {
        left: 0;
    }
    
    .nav.active .mobile-menu-overlay {
        opacity: 1;
        visibility: visible;
    }
    
    .nav-item {
        width: 100%;
        padding: 10px 0;
        border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    }

    .nav-icon {
        width: 32px;
        height: 32px;
    }
    
    .tel-icon {
        height: 38px;
    }
}

@media (max-width: 900px) {    
    .header {
        flex-direction: column;
        align-items: center;
        gap: 15px;
        min-height: auto;
        padding-top: 100px;
    }
    
    .services-grid {
        grid-template-columns: minmax(250px, 1fr);
    }
}

@media (max-width: 768px) {
    .station-name,
    .map-area {
        width: 90%;
        max-width: 500px;
    }
    
    .business-hours {
        top: -20px;
        margin-bottom: 40px;
    }
    
    .business-hours img {
        max-width: 330px;
    }
    
    .oval-container {
        width: 95%;
        flex-direction: column;
        align-items: center;
    }
    
    .oval-wrapper {
        min-width: auto;
        width: 100%;
    }
    
    #flow .oval-wrapper:first-child .oval {
        width: 280px;
        min-width: 280px;
    }

    .dialogue-container {
        gap: 30px;
    }
    
    .dialogue-user {
        padding-left: 0;
    }
    
    .dialogue-provider {
        padding-right: 0;
    }
    
    .dialogue-combined {
        width: 320px;
    }
    
    .dialogue-provider .dialogue-combined {
        width: 460px;
    }
    
    /* イメージキャラクターのレスポンシブ対応 */
    .mascot-container {
        margin: 30px auto 15px;
    }
    
    .mascot-img {
        width: 150px; /* モバイル表示では小さく */
    }
}

@media (max-width: 480px) {
    .nav {
        gap: 10px;
    }
    
    .nav-icon {
        width: 28px;
        height: 28px;
    }
    
    .tel-icon {
        height: 35px;
    }
    
    .business-hours {
        top: -15px;
        margin-bottom: 30px;
    }
    
    .business-hours img {
        max-width: 75%;
    }
    
    .dialogue-container {
        gap: 20px;
    }
    
    .dialogue-combined {
        width: 300px;
    }
    
    .dialogue-provider .dialogue-combined {
        width: 420px;
    }
    
    .oval {
        width: 220px;
        min-height: 60px;
        padding: 10px 3px;
        font-size: 0.9em;
    }
    
    #flow .oval-wrapper:first-child .oval {
        width: 260px;
        min-width: 260px;
    }
    
    .service-icon {
        width: 24px;
        height: 24px;
        margin-right: 6px;
    }
}