:root{
    --main-color: #38B2D4;
    --accent-color: #ED7F8E;
    --font-color: #4D4D4D;
    --white: #fff;
    --chat-pink: 60px;
    --mascot-width: 60px;
    --mascot-width--sp: 40px;
}

/* base */
html {
    font-size: 16px;
    line-height: 1.5;
    color: var(--font-color);
    font-family: 'Zen Maru Gothic', sans-serif;
    font-weight: 500;
}

@media (max-width: 768px) {
    html {
        font-size: 14px;
    }
}

body {
    background-color: #F6F8F9;
    background-image: url(../img/bg.png);
    background-repeat: no-repeat;
    background-size: cover;

}

textarea::placeholder,
input[type="text"]::placeholder{
    color: #BABABA;
}

/* layout */
.wrapper {
    display: flex;
    position: relative;
    flex-direction: column;
    justify-content: space-between;
    height: 100dvh;
    max-width: 800px;
    margin: 0 auto;
    background-color: var(--white);
}

/* chat */
.chat-container {
    flex-grow: 1;
    overflow-y: auto;
    padding: 70px 2rem 1rem;
    z-index: 1;
}

.message-container {
    display: flex;
    margin-bottom: 2rem;
    max-width: 90%;
}

.message-container.user-message {
    justify-content: flex-end;
    margin-left: auto;
}

.message-container.ai-message {
    position: relative;
    justify-content: flex-start;
    padding-left: calc( var(--mascot-width) + 25px );
}

.message-container.ai-message::before{
    content: '';
    display: inline-block;
    position: absolute;
    bottom: 0;
    left: 0;
    width: var(--mascot-width);
    aspect-ratio: 2/3;
    background-image: url(../img/icon_ai.svg);
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
}

.message-container.ai-message:nth-child(6n - 1):before{
    background-image: url(../img/ai-icon02.svg);
}
.message-container.ai-message:nth-child(6n - 2):before{
    background-image: url(../img/ai-icon03.svg);
}
.message-container.ai-message:nth-child(6n - 3):before{
    background-image: url(../img/ai-icon04.svg);
}
.message-container.ai-message:nth-child(6n - 4):before{
    background-image: url(../img/ai-icon05.svg);
}
.message-container.ai-message:nth-child(6n - 5):before{
    background-image: url(../img/ai-icon06.svg);
}

#chat-back-link {
    position: absolute;
    top: 7px;
    left: 13px;
    z-index: 1000;
    background: #fff;
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    box-shadow: 0 0.125rem 0.5rem rgba(0, 0, 0, 0.24);
    text-decoration: none;
    color: #38B2D4;
    display: block;
}

.message-bubble {
    position: relative;
    padding: 1.7rem 1.5rem;
    border-radius: 1.5rem;
    max-width: 100%;
    word-wrap: break-word;
}

.message-bubble.user-bubble {
    background-color: var(--main-color);
    color: var(--white);
}

.message-bubble.user-bubble::after {
    content: '';
    position: absolute;
    bottom: min( 20px, 15% );
    left: calc( 100% - 6px );
    width: 25px;
    height: 35px;
    background-image: url(../img/bubble_user.svg);
    background-repeat: no-repeat;
    background-size: contain;
    background-position: left;
}

.message-bubble.ai-bubble {
    background-color: var(--white);
}

.message-bubble.ai-bubble::before{
    content: '';
    display: inline-block;
    position: absolute;
    top: -3px; 
    bottom: -3px;
    left: -3px; 
    right: -3px;
    background: linear-gradient(to top, var(--accent-color) 0%, var(--accent-color) var(--chat-pink), var(--white) var(--chat-pink), var(--white) calc( var(--chat-pink) + 7px ), var(--main-color) calc( var(--chat-pink) + 7px ), var(--main-color) 100%);
    border-radius: calc( 1.5rem + 3px );
    z-index: -1;
}

.message-bubble.ai-bubble::after {
    content: '';
    position: absolute;
    bottom: 32px;
    right: 100%;
    width: 20px;
    height: 26px;
    background-image: url(../img/bubble_ai.svg);
    background-repeat: no-repeat;
    background-size: contain;
    background-position: right bottom;
}

.input-container {
    padding: 1.5rem 1.5rem 0;
    background-color: #BDF1FF;
    bottom: 0;
    z-index: 2;
}

.input-container__comment{
    display: block;
    font-size: .875rem;
    text-align: center;
    margin-top: 5px;
    margin-bottom: 7px;
}

.input-wrapper {
    display: flex;
    position: relative;
}

.chat-input {
    flex-grow: 1;
    padding: 0.8rem;
    border-radius: 0.5rem;
    border: 2px solid #98D4E5;
    font-size: 16px;
    resize: none;
    background-color: var(--white);
    min-height: 100px;
    max-height: 120px;
    overflow-y: auto;
    box-shadow: 2px 2px 2px 0px rgba(0, 0, 0, 0.12) inset;
}

.send-button {
    width: 3rem;
    height: 3rem;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: 1rem;
    cursor: pointer;
    transition: .2s;
}

.send-button:not(:disabled):hover{
    opacity: .8;
}

.send-button:disabled {
    cursor: not-allowed;
}

@media (max-width: 768px) {
    .chat-container{
        padding: 40px 25px 1rem; 
    }

    .input-container {
        padding: 1rem 1rem 0;
    }

    .send-button {
        margin-left: .5rem;
    }

    .message-container {
        max-width: 100%;
    }

    .message-container.ai-message {
        padding-left: calc( var(--mascot-width--sp) + 25px );
        min-height: calc(var(--mascot-width--sp) * 1.5 + 15px);
    }
    
    .message-container.ai-message::before{
        bottom: 15px;
        width: var(--mascot-width--sp);
    }
}

/* form */
.question-form {
    margin-top: 0.5rem;
    background-color: var(--white);
    border-radius: 0.5rem;
    max-width: 100%;
    margin-left: auto;
}

.question-title {
    font-weight: bold;
    margin-bottom: 0.5rem;
}

.options-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.radio-group {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.question-item{
    margin-bottom: 1.5rem;
}

.text-input {
    font-size: 16px;
    background-color: var(--white);
    border: 2px solid #E6E6E6;
    border-radius: 8px;
    padding: .5rem 10px;
}

.select-input{
    appearance: none;
    border: 2px solid #E6E6E6;
    border-radius: 8px;
    padding: 0 10px;
    height: 40px;
    position: relative;
    background-color: var(--white);
    background-image: url(../img/arrow-down.svg);
    background-repeat: no-repeat;
    background-position: right 10px center;
}

.radio-group,
.checkbox-group {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.radio-option,
.checkbox-option{
    position: relative;
    display: flex;
    border-radius: 8px;
    border: 2px solid #E6E6E6;
    box-shadow: 0px 0px 80px 0px rgba(56, 178, 212, 0.09);
}

.radio-option input[type="radio"],
.checkbox-option input[type="checkbox"]{
    position: absolute;
    white-space: nowrap;
    border: 0;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    overflow: hidden;
    height: 1px;
    width: 1px;
    margin: -1px;
    padding: 0;
}

.radio-option:has(input[type="radio"]:checked),
.checkbox-option:has(input[type="checkbox"]:checked){
    border-color: #6FCAE3;
}
.radio-option:has(input[type="radio"]:focus-visible),
.checkbox-option:has(input[type="checkbox"]:focus-visible){
	outline: 2px solid CanvasText;
    outline-offset: 1px;
}

.radio-option label,
.checkbox-option label{
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
    padding: .5rem .5rem .5rem 1.7rem;
}

.checkbox-option label::before{
    content: '';
    display: block;
    position: absolute;
    top: calc( 50% + 1px );
    left: .5rem;
    transform: translateY(-50%);
    border-radius: 2px;
    border: 2px solid #E6E6E6;
    width: 1rem;
    aspect-ratio: 1/1;
}

.checkbox-option input[type="checkbox"]:checked + label::before { 
    border-color: var(--main-color);
    background-color: var(--main-color);
}
.checkbox-option input[type="checkbox"]:checked + label::after { 
    content: '';
    display: block;
    position: absolute;
    top: 50%;
    left: calc( 6px + .5rem );
    transform: translateY(-50%) rotate(45deg);
    border-right: 2px solid var(--white); 
    border-bottom: 2px solid var(--white); 
    width: 5px; 
    height: 10px;
}

.radio-option label::before{
    content: '';
    display: block;
    position: absolute;
    top: calc( 50% + 1px );
    left: .5rem;
    transform: translateY(-50%);
    border-radius: 50%;
    border: 2px solid var(--main-color);
    width: .875rem;
    aspect-ratio: 1/1;
}

.radio-option input[type="radio"]:checked + label::after { 
    content: '';
    position: absolute;
    top: calc( 50% + 1px );
    left: calc(.875rem * 0.5 + .5rem);
    transform: translate(-50%,-50%);
    display: block;
    border-radius: 50%;
    width: calc( .875rem * 0.5 );
    aspect-ratio: 1/1;
    background-color: var(--main-color);
}

.form-submit{
    box-sizing: border-box;
    display: block;
    border-radius: 8px;
    background: var(--main-color);
    color: var(--white);
    font-weight: bold;
    text-align: center;
    box-shadow: 2px 2px 2px 0px rgba(0, 0, 0, 0.04);
    width: 100%;
    padding: 0.5rem 1rem;
    margin-top: 1.5rem;
    cursor: pointer;
    transition: .2s;
}

.form-submit:hover{
    opacity: .8;
}

@media (max-width: 768px) {
    .question-item {
        margin-bottom: 1rem;
    }
    
    .radio-group,
    .checkbox-group {
        flex-direction: column;
    }

    .checkbox-option input[type="checkbox"]:checked + label::after { 
        left: calc( 5px + .5rem );
        width: 4px; 
        height: 8px;
    }
}


/* toppage */
.top_wrapper{
    min-height: 100vh;
    max-width: 800px;
    margin: 0 auto;
    padding: 32px min( 5vw, 24px );
}

.top_wrapper .input-wrapper{
    margin-top: 20px;
}

.top_title{
    display: flex;
    align-items: center;
    justify-content: center;
    width: 80%;
    max-width: 300px;
    margin-left: auto;
    margin-right: auto;
}

.toppage_items{
    background-color: var(--white);
    border-radius: 24px;
    box-shadow: 0px 0px 80px 0px rgba(56, 178, 212, 0.09);
    margin-top: 30px;
    padding: 1rem 1.5rem;
}

.toppage_text_box{
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}


.toppage_text{
    display: flex;
    align-items: center;
    gap: 10px;
    position: relative;
    font-size: 1.5rem;
    font-weight: bold;
    text-align: center;
    padding-left: 3.5rem;
}

.toppage_michibiki{
    width: 3.5rem;
    aspect-ratio: 2/3;
}

.toppage_text_link{
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    margin-top: 10px;
}

.toppage_links{
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 40px;
    margin-top: 25px;
}

.toppage_button{
    position: relative;
    display: inline-flex;
    align-items: center;
    border-radius: 8px;
    border: 2px solid #E6E6E6;
    background: #FFF;
    padding: .5rem .8rem;
    text-decoration: none;
    transition: .2s;
}

.toppage_button:hover{
    opacity: .8;
}

.toppage_button__icon{
    width: 1rem;
    height: 1rem;
    margin-right: 6px;
}

.toppage_button.samples .toppage_button__icon{
    transform: rotateY(180deg);
}

.samples_section{
    position: relative;
    padding-left: 4.5rem;
    margin-top: 20px;
}

.samples_section::before{
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 3.5rem;
    aspect-ratio: 2/3;
    background-image: url(../img/michibiky.svg);
    background-repeat: no-repeat;
    background-size: contain;
    background-position: bottom;
}

.samples_section__title{
    font-size: .875rem;
    font-weight: bold;
    margin-bottom: 10px;
}

.samples_wrapper{
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.toppage_comment{
    display: block;
    font-size: .875rem;
    line-height: 1.8;
    text-align: center;
    margin-top: 1rem;
}

.toppage_logo-ad{
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 50px;
}

.toppage_logo-ad__link{
    width: 60%;
    max-width: 300px;
    transition: .2s;
}

.toppage_logo-ad__link:hover{
    opacity: .8;
}

@media (max-width: 768px) {
    .toppage_text{
        font-size: 1.3rem;
        padding-left: unset;
    }

    .toppage_michibiki{
        position: absolute;
        bottom: calc( 100% - 1.5em );
        right: 0;
    }

    .samples_section{
        padding-left: unset;
    }
    
    .samples_section::before{
        content: unset;
    }
}

/* modal */
.modal_fixed{
    /* bodyのスクロール停止用 */
    overflow: hidden;
}

.modal{
    position: fixed;
    top: 0;
    left: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    background-color: transparent;
}

.modal__bg{
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    background: rgba(0, 0, 0, 0.19);
}

.modal__box{
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 90%;
    max-width: 1200px;
    max-height: 90svh;
    padding: min( 8vw, 60px ) min( 4vw, 60px );
    background-color: var(--white);
    border-radius: 24px;
    z-index: 1;
}

.modal__main{
    height: 90%;
    overflow-y: auto;
}

.modal__close{
    color: var(--white);
    font-size: 1.125rem;
    background-color: var(--main-color);
    padding: .4em .8em;
    margin-top: 20px;
    border-radius: 8px;
    transition: .2s;
}

.modal__close:hover{
    opacity: .8;
}

/* terms_dialog */
.terms_dialog__box{
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    overflow-y: scroll;
}

.terms_dialog__title{
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: calc( 70% - 10px );
    max-width: 300px;
    margin-left: auto;
    margin-right: auto;
    margin-bottom: 30px;
}

.terms_dialog__title::after{
    content: '';
    position: absolute;
    bottom: 0;
    left: calc( 100% + 30px );
    width: 25%;
    aspect-ratio: 2 / 3;
    background-image: url(../img/michibiky02.svg);
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
}

@media (max-width: 1440px) {
    .terms_dialog__title{
        max-width: 240px;
    }
}
@media (max-width: 768px) {
    .terms_dialog__title{

    }

    .terms_dialog__title::after{
        left: calc( 100% + 10px );
    } 
}

.terms_dialog__section_wrapper{
    display: grid;
    grid-template-columns: repeat(2,1fr);
    gap: 30px;  
}

@media (max-width: 768px) {
    .terms_dialog__section_wrapper{
        grid-template-columns: 1fr;
        overflow-y: auto;
    }    
}

.terms_dialog__section{
    display: flex;
    flex-direction: column;
    align-items: center;
}

.terms_dialog__section.--term{
    height: 420px;
}

.terms_dialog__section__title{
    color: var(--main-color);
    font-size: 1.5rem;
    text-align: center;
    margin-bottom: 15px;
}

@media (max-width: 768px) {
    .terms_dialog__section__title{
        font-size: 1.3rem;
    }
}

.terms_dialog__terms{
    height: 70%;
    border: 1px solid #C9C9C9;
    padding: 1rem;
    overflow-y: auto;
}

/* terms */
.terms{
    color: #000;
}

.terms__section + .terms__section{
    margin-top: 30px;
}

.terms__section_title{
    font-size: 1.2rem;
    font-weight: bold;
}

.terms__list{
    padding: 0;
    list-style: none;
    margin-top: 20px;
}

.terms__item + .terms__item{
    margin-top: 1rem;
}

.terms__title{
    font-size: 1.1rem;
    font-weight: bold;
}

/* list_basic */
.ordered_list{
    list-style: decimal;
    padding-left: 1em;
}

.unordered_list{
    list-style: disc;
    padding-left: 1.2em;
}

/* text_link */
.text_link{
    color: var(--main-color);
    text-decoration: underline;
    transition: .2s;
}

.text_link:hover{
    text-decoration: none;
}

/* utility */
.u-display--sp{
    display: none;
}

@media (max-width: 768px) {
    .u-display--sp{
        display: block;
    }
}