.page-intro { text-align: center; padding: 60px 0 40px; }
.page-title { font-weight: 200; font-size: 2.4rem; letter-spacing: 0.2em; margin: 0; }

.qa-container {
    max-width: 800px;
    margin: 0 auto 120px;
}

.qa-category {
    margin-bottom: 80px;
}

.category-title {
    font-size: 0.8rem;
    letter-spacing: 0.3em;
    color: #ccc;
    margin-bottom: 30px;
    font-weight: bold;
    border-bottom: 1px solid #f0f0f0;
    padding-bottom: 15px;
}

.qa-item {
    border-bottom: 1px solid #f0f0f0;
}

.qa-question {
    width: 100%;
    padding: 25px 0;
    background: none;
    border: none;
    text-align: left;
    font-size: 1rem;
    color: #333;
    cursor: pointer;
    position: relative;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: color 0.3s;
}

.qa-question::after {
    content: '+';
    font-size: 1.2rem;
    color: #ccc;
    font-weight: 200;
    transition: transform 0.4s ease;
}

.qa-item.active .qa-question {
    color: #999;
}

.qa-item.active .qa-question::after {
    transform: rotate(45deg);
}

.qa-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.5s cubic-bezier(0, 1, 0, 1);
}

.qa-item.active .qa-answer {
    max-height: 1000px;
    transition: max-height 1s ease-in;
}

.qa-answer p {
    padding: 0 0 25px 0;
    margin: 0;
    font-size: 0.95rem;
    line-height: 1.9;
    color: #666;
}

/* スマホ最適化 */
@media (max-width: 768px) {
    .page-intro { padding: 40px 0 20px; }
    .page-title { font-size: 1.8rem; }
    .qa-container { padding: 0 10px; margin-bottom: 100px; }
    .qa-category { margin-bottom: 56px; }
    .qa-question { font-size: 0.95rem; padding: 20px 0; }
    .qa-answer p { font-size: 0.9rem; }
}

/* ==========================================
   AI コンシェルジュ フローティングウィジェット
   ========================================== */

/* ラッパー: position:fixed+top:0 でビューポート上端に固定する。
   Instagram/LINE 等 WKWebView では fixed+bottom が正しく動かない既知バグがあるため、
   ラッパーを top:0 で固定し、子要素は absolute+bottom で配置することで回避する。
   height: 100svh = ブラウザ Chrome を除いたビューポート高（サポートブラウザ優先）。
   overflow:visible で子要素のはみ出しを許容する。 */
#ai-fixed-wrap {
    position: fixed;
    inset: 0;
    min-height: 100vh;
    min-height: 100svh;
    width: 100%;
    pointer-events: none;
    z-index: 10000;
    overflow: hidden;
}

.ai-fab {
    position: absolute;
    bottom: 32px;
    right: 32px;
    height: 48px;
    padding: 0 20px 0 16px;
    border-radius: 24px;
    background: #333;
    color: #fff;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.18);
    transition: background 0.3s, transform 0.2s;
    pointer-events: auto;
}

.ai-fab-label {
    font-size: 0.72rem;
    letter-spacing: 0.18em;
    white-space: nowrap;
    font-family: inherit;
}

.ai-fab:hover { background: #555; transform: scale(1.03); }

.ai-chat-popup {
    position: absolute;
    bottom: 100px;
    right: 32px;
    width: 360px;
    background: #fff;
    border: 1px solid #e8e8e8;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.12);
    display: flex;
    flex-direction: column;
    opacity: 0;
    transform: translateY(12px);
    pointer-events: none;
    transition: opacity 0.25s ease, transform 0.25s ease;
}

.ai-chat-popup.is-open {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.ai-chat-popup-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 20px;
    border-bottom: 1px solid #eee;
}

.ai-popup-label {
    font-size: 0.75rem;
    letter-spacing: 0.25em;
    color: #333;
    margin: 0 0 4px;
    font-weight: 500;
}

.ai-popup-sub {
    font-size: 0.78rem;
    color: #aaa;
    letter-spacing: 0.04em;
    margin: 0;
}

.ai-popup-close {
    background: none;
    border: none;
    color: #bbb;
    font-size: 0.9rem;
    cursor: pointer;
    padding: 4px;
    line-height: 1;
    transition: color 0.2s;
}

.ai-popup-close:hover { color: #333; }

#inline-chat-history {
    height: 280px;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.message {
    max-width: 85%;
    font-size: 0.88rem;
    line-height: 1.8;
    letter-spacing: 0.03em;
    word-wrap: break-word;
    padding: 12px 16px;
}

.ai-message {
    align-self: flex-start;
    background: #f8f8f8;
    color: #555;
    border-left: 2px solid #ddd;
}

.user-message {
    align-self: flex-end;
    background: #fff;
    color: #333;
    border: 1px solid #e0e0e0;
}

.ai-chat-popup-footer {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 20px;
    border-top: 1px solid #eee;
}

#inline-chat-input {
    flex-grow: 1;
    padding: 8px 0;
    border: none;
    border-bottom: 1px solid #ddd;
    outline: none;
    font-size: 0.88rem;
    font-family: inherit;
    letter-spacing: 0.04em;
    color: #333;
    background: transparent;
    transition: border-color 0.3s;
}

#inline-chat-input::placeholder { color: #ccc; }
#inline-chat-input:focus { border-bottom-color: #999; }

#inline-send-btn {
    background: none;
    color: #999;
    border: 1px solid #ddd;
    padding: 7px 16px;
    font-size: 0.72rem;
    font-family: inherit;
    letter-spacing: 0.18em;
    cursor: pointer;
    transition: all 0.25s;
    white-space: nowrap;
}

#inline-send-btn:hover { border-color: #333; color: #333; }

@media (max-width: 768px) {
    .ai-fab { bottom: 20px; right: 16px; height: 44px; padding: 0 16px 0 14px; }
    .ai-fab-label { font-size: 0.68rem; }

    /* LINEトーク再現: 全画面表示。
       height/top は visualViewport API で JS が上書きするため CSS はフォールバック。
       transform アニメーションは開閉時のみ。キーボード表示中は JS が transition:none で
       高さを即座に更新するため「下から出る」アニメーションは発生しない。 */
    .ai-chat-popup {
        position: fixed;
        inset: 0;
        width: 100%;
        height: 100%;
        border-radius: 0;
        border: none;
        max-height: none;
        transform: translateY(100%);
        overflow: hidden;
    }

    .ai-chat-popup-header {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        z-index: 1001;
        background: #fff;
        -webkit-backdrop-filter: blur(4px);
        backdrop-filter: blur(4px);
    }

    .ai-chat-popup-footer {
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 1001;
        background: #fff;
    }

    #inline-chat-history {
        position: absolute;
        left: 0;
        right: 0;
        top: 56px; /* JS will set exact value on open */
        bottom: 56px; /* JS will set exact value on open */
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    .ai-chat-popup.is-open {
        transform: translateY(0);
    }

    /* ホームインジケータ対応 + 画面の丸角で隠れないよう余白を確保 */
    .ai-chat-popup .ai-chat-popup-footer {
        padding-bottom: max(24px, env(safe-area-inset-bottom, 0px));
    }

    .ai-chat-popup .ai-popup-close {
        font-size: 1.4rem;
        padding: 10px;
        color: #888;
        min-width: 44px;
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    /* iOS 自動ズーム防止 */
    #inline-chat-input {
        font-size: 16px;
    }
}