<style>
<style>
/* Inquiry Manager Plugin CSS */
.inquiry-list-wrapper, .inquiry-frontend-wrapper {
    margin-top: 20px;
    background-color: #f9f9f9;
    border: 1px solid #ddd;
    padding: 20px;
    border-radius: 8px;
    font-family: "Inter", sans-serif;
}

.inquiry-bubble {
    display: flex; /* これを残して、外側のinquiry-bubbleのレイアウトを維持 */
    margin-bottom: 15px;
    margin-right: 15px;
    padding: 15px;
    border: 1px solid #ccc;
    border-radius: 12px;
    background-color: #eee; /* 薄い青背景 */
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    flex-wrap: wrap; /* Responsive wrap for smaller screens */
}

.inquiry-bubble.inquiry-side-1 {
    background-color: #e0f2f7; /* 薄い青背景 */
    border-color: #0073aa; /* 黒枠 (WordPressデフォルトの青) */
    justify-content: flex-start;
    margin-right: auto;
    /* 応答枠全体の枠線を削除（inquiry_answordsが囲むため） */
    border: none;
    box-shadow: none;
    padding: 0;
    left: 1rem;
    min-width: 40rem;
}

.inquiry-bubble.inquiry-side-2 {
    background-color: #fffde7; /* 薄い黄色背景 */
    border-color: #ec0c120; /* 黄色の枠 */
    justify-content: flex-end;
    margin-left: auto;
    /* 応答枠全体の枠線を削除（inquiry_answordsが囲むため） */
    border: none;
    box-shadow: none;
    padding: 0;
    right: 1rem;
    min-width: 40rem;
}


@media (max-width: 1100px) {
    .inquiry-bubble.inquiry-side-1 {
        min-width: 30rem;
    }
    .inquiry-bubble.inquiry-side-2 {
        min-width: 30rem;
    }
}
@media (max-width: 800px) {
    .inquiry-bubble.inquiry-side-1 {
        min-width: 22rem;
    }
    .inquiry-bubble.inquiry-side-2 {
        min-width: 22rem;
    }
}

/* 応答をまとめる新しい枠 */
.inquiry_answords {
    width: 94%; /* 親のinquiry-bubbleの幅に合わせる */
    background-color: #efe; /* 白背景 */
    border: 1px solid #e0e0e0; /* 薄いグレーの枠線 */
    border-radius: 8px;
    padding: 15px;
    margin-top: 15px; /* 親のinquiry-bubbleとの間にスペース */
    display: flex; /* Flexboxを有効にして子要素をコントロール */
    flex-direction: column; /* 子要素を縦に並べる */
    gap: 15px; /* 子要素間の隙間 */
}

/* inquiry_answords内の個々の応答枠のスタイル（吹き出し化） */
.inquiry_answords > .inquiry-bubble {
    max-width: 75%; /* 吹き出しの最大幅 */
    padding: 12px 18px; /* パディングを調整 */
    border-radius: 18px; /* 角丸をより強く */
    position: relative; /* 擬似要素の位置指定のため */
    box-shadow: 0 1px 3px rgba(0,0,0,0.1); /* シャドウを調整 */
    border: none; /* ボーダーは擬似要素で表現するため削除 */
    margin-bottom: 0; /* 親のgapで間隔を取るため削除 */
}

/* inquiry_answords内の左寄せ吹き出し (inquiry-side-1) */
.inquiry_answords > .inquiry-bubble.inquiry-side-1 {
    align-self: flex-start; /* 左寄せ */
    background-color: #e0f2f7; /* 薄い青背景 */
    color: #333;
    border-top-left-radius: 0; /* 三角形のため左上角を0に */
}

.inquiry_answords > .inquiry-bubble.inquiry-side-1::before {
    content: '';
    position: absolute;
    top: 0;
    left: -10px; /* 吹き出しの外側に出す */
    border-width: 0 10px 10px 0; /* 三角のサイズと方向 */
    border-style: solid;
    border-color: transparent #e0f2f7 transparent transparent; /* 背景色と同じ色で三角を作成 */
    z-index: 1; /* 内容より手前に表示 */
}

/* inquiry_answords内の右寄せ吹き出し (inquiry-side-2) */
.inquiry_answords > .inquiry-bubble.inquiry-side-2 {
    align-self: flex-end; /* 右寄せ */
    background-color: #fffde7; /* 薄い黄色背景 */
    color: #333;
    border-top-right-radius: 0; /* 三角形のため右上角を0に */
}

.inquiry_answords > .inquiry-bubble.inquiry-side-2::after {
    content: '';
    position: absolute;
    top: 0;
    right: -10px; /* 吹き出しの外側に出す */
    border-width: 10px 10px 0 0; /* 三角のサイズと方向 */
    border-style: solid;
    border-color: #fffde7 transparent transparent transparent; /* 背景色と同じ色で三角を作成 */
    z-index: 1; /* 内容より手前に表示 */
}

.inquiry-bubble .bubble-header {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 5px;
    padding-bottom: 5px;
    border-bottom: 1px solid rgba(0,0,0,0.1);
}

.inquiry-bubble .bubble-title {
    font-size: 1.1em;
    font-weight: bold;
    margin: 0;
    color: #333;
}
.inquiry-bubble .bubble-title a {
    text-decoration: none;
    color: #0073aa;
}
.inquiry-bubble .bubble-title a:hover {
    text-decoration: underline;
}

.inquiry-bubble .bubble-title-no-link {
    font-size: 1.1em;
    font-weight: bold;
    margin: 0;
    color: #333;
    flex-grow: 1;
}

.inquiry-bubble .bubble-date {
    font-size: 0.8em;
    color: #666;
    white-space: nowrap;
}

.inquiry-bubble .bubble-meta {
    width: 100%;
    font-size: 0.9em;
    color: #555;
    margin-top: 5px;
    margin-bottom: 10px;
}
.inquiry-bubble .bubble-type {
    font-weight: bold;
    margin-right: 5px;
}

.inquiry-bubble .bubble-message {
    width: 100%;
    line-height: 1.6;
    color: #333;
}

/* 応答行の3ブロックレイアウト */
.inquiry-bubble .bubble-info-block {
    flex: 1; /* 1/3 幅 */
    min-width: 120px; /* 最小幅 */
    padding-right: 10px;
    border-right: 1px solid rgba(0,0,0,0.1);
    font-size: 0.85em;
    color: #444;
}
/* inquiry_answords内の応答枠では、情報ブロックのボーダーを調整 */
/* 吹き出しデザインでは情報ブロックを縦に表示するため、ボーダーを削除し、flex-direction: column; に変更 */
.inquiry_answords > .inquiry-bubble .bubble-info-block {
    border-right: none;
    padding-right: 0;
    margin-bottom: 5px; /* 下にスペース */
    text-align: inherit; /* 親のテキスト配置を継承 */
}

.inquiry_answords > .inquiry-bubble.inquiry-side-2 .bubble-info-block {
    order: 0; /* 吹き出し内では情報ブロックを先頭に戻す */
    border-left: none; /* ボーダーを削除 */
    padding-left: 0;
    text-align: inherit; /* 親のテキスト配置を継承 */
}

.inquiry-bubble .bubble-message-block {
    flex: 2; /* 2/3 幅 */
    padding-left: 10px;
    line-height: 1.6;
    color: #333;
}
/* inquiry_answords内のメッセージブロックは縦に配置 */
.inquiry_answords > .inquiry-bubble .bubble-message-block {
    padding-left: 0;
    padding-right: 0;
    text-align: inherit; /* 親のテキスト配置を継承 */
}

.inquiry-bubble.inquiry-side-2 .bubble-message-block {
    order: 0; /* 吹き出し内ではメッセージブロックを情報ブロックの後に配置 */
}

.inquiry-bubble .bubble-title-small {
    font-weight: bold;
}


/* フォームスタイル */
.form-table th {
    vertical-align: top;
    padding-top: 10px;
}
.form-table td {
    padding-top: 8px;
}
.form input[type="text"],
.form input[type="email"],
.form textarea {
    width: 100%;
    max-width: 350px;
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-sizing: border-box;
}
.form textarea {
    resize: vertical;
}
.form input[type="submit"],
.form input[type="reset"],
.button {
    background-color: #0073aa;
    color: #fff;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
    transition: background-color 0.3s ease;
    text-decoration: none; /* for anchor buttons */
    display: inline-block;
    margin-right: 10px;
}
.form input[type="submit"]:hover,
.form input[type="reset"]:hover,
.button:hover {
    background-color: #005177;
}
.button.button-primary {
    background-color: #0073aa;
}
.button.button-primary:hover {
    background-color: #005177;
}

/* ポップアップ/モーダルスタイル */
.inquiry-modal-overlay {
    display: none; /* hidden by default */
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    justify-content: center;
    align-items: center;
    z-index: 10000;
}

.inquiry-modal-content {
    background-color: #fff;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    max-width: 600px;
    width: 90%;
    box-sizing: border-box;
    position: relative;
    font-family: "Inter", sans-serif;
    top:10rem;
    margin:auto;
}

.inquiry-modal-close-button {
    position: absolute;
    top: 15px;
    right: 15px;
    font-size: 24px;
    cursor: pointer;
    background: none;
    border: none;
    color: #666;
}
.inquiry-modal-close-button:hover {
    color: #333;
}

.inquiry-modal-content h3 {
    margin-top: 0;
    color: #333;
    font-size: 1.4em;
    border-bottom: 2px solid #eee;
    padding-bottom: 10px;
    margin-bottom: 20px;
}

.inquiry-modal-content p.guide-message {
    font-size: 1.1em;
    margin-bottom: 20px;
    color: #0073aa;
    font-weight: bold;
}

.inquiry-modal-content .form th {
    text-align: left;
    padding-right: 15px;
    vertical-align: top;
    white-space: nowrap;
    padding-top: 10px;
}
.inquiry-modal-content .form td {
    padding-top: 10px;
}

.inquiry-modal-content .form input[type="text"],
.inquiry-modal-content .form input[type="email"],
.inquiry-modal-content .form textarea {
    background-color: #f0f0f0;
    border: 1px solid #ddd;
    color: #555;
    cursor: default;
    width: 100%;
    box-sizing: border-box;
    padding: 8px;
    border-radius: 4px;
    resize: none; /* textarea resize disabled in modal */
}

.inquiry-modal-content .modal-buttons {
    text-align: center;
    margin-top: 30px;
}
.inquiry-modal-content .modal-buttons .button {
    margin: 0 10px;
}


/* inquiry-reply-formのスタイルを調整 */
.inquiry-reply-form {
    display: flex; /* 子要素を横並びにする */
    align-items: flex-end; /* 複数行の場合に下端を揃える */
    gap: 0; /* Flexアイテム間のデフォルトの隙間をなくす */
    margin-top: 20px; /* 必要に応じて調整 */
}

/* textareaのスタイルを調整 */
.inquiry-reply-form textarea {
    /* Flexアイテムとして適切な幅を設定 */
    flex-grow: 1; /* 利用可能なスペースを埋める */
    max-width: calc(100% - 120px); /* ボタンと余白分のスペースを確保（約100px + 20px） */
    min-width: 200px; /* 最小幅（任意） */
    margin-bottom: 0; /* flexboxで配置するため不要 */
    box-sizing: border-box; /* paddingやborderをwidthに含める */
    resize: vertical; /* 縦方向のみリサイズ可能にする */
    padding: 8px; /* パディングを適切に設定 */
    border: 1px solid #ccc;
    border-radius: 4px;
}

/* 返信ボタンのスタイルを調整 */
.inquiry-reply-form #submit_reply_btn {
    position: static; /* 絶対配置を解除し、通常のフローに戻す */
    margin-left: 1ch; /* 1文字分の左マージン (chは文字幅単位) */
    /* 必要に応じて、ボタンのサイズやパディングを調整 */
    padding: 8px 15px;
    font-size: 0.9em;
    white-space: nowrap; /* ボタン内のテキストが改行されないようにする */
}





/* スピナー（ローディングインジケーター） */
.inquiry-spinner {
    border: 4px solid rgba(0, 0, 0, 0.1);
    border-left-color: #0073aa;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    animation: spin 1s linear infinite;
    display: none; /* Hidden by default */
    vertical-align: middle;
    margin-left: 10px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* レスポンシブ対応 */
@media (max-width: 768px) {
    .inquiry-bubble {
        flex-direction: column;
    }
    .inquiry-bubble .bubble-info-block,
    .inquiry-bubble .bubble-message-block {
        flex: none;
        width: 100%;
        padding: 0;
        border: none;
    }
    .inquiry-bubble.inquiry-side-2 .bubble-info-block,
    .inquiry-bubble.inquiry-side-2 .bubble-message-block {
        order: unset;
        text-align: left;
    }
    .inquiry-bubble .bubble-header {
        flex-direction: column;
        align-items: flex-start;
    }
    .inquiry-bubble .bubble-date {
        margin-top: 5px;
    }

    /* レスポンシブ時のinquiry_answords内の応答枠調整 */
    .inquiry_answords > .inquiry-bubble {
        max-width: 90%; /* 小さい画面ではもう少し広げる */
        padding: 10px; /* パディングを調整 */
    }
    .inquiry_answords > .inquiry-bubble .bubble-info-block,
    .inquiry_answords > .inquiry-bubble .bubble-message-block {
        padding: 0;
        border: none;
        text-align: left;
    }
    .inquiry_answords > .inquiry-bubble.inquiry-side-2 .bubble-info-block {
        order: unset;
        text-align: left;
    }
    .inquiry_answords > .inquiry-bubble.inquiry-side-2 .bubble-message-block {
        order: unset;
        text-align: left;
    }
    /* 吹き出しの三角もレスポンシブで調整が必要な場合 */
    .inquiry_answords > .inquiry-bubble.inquiry-side-1::before,
    .inquiry_answords > .inquiry-bubble.inquiry-side-2::after {
        top: 0; /* 上端に固定 */
    }
}
</style>
