:root {
    --bot-color: #007bff;
    --user-message-bg: #e3f2fd;
    --user-message-text-color: #333;
    --bot-message-bg: #ffffff;
    --bot-message-text-color: #333;
    --thinking-message-bg: #e9ecef;
    --chat-bg: #f8f9fa;
    --button-bg-color: #343a40;
    --button-text-color: #ffffff;
}

* { 
    margin: 0; 
    padding: 0; 
    box-sizing: border-box; 
}

body { 
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, 'ヒラギノ角ゴ ProN W3', 'Hiragino Kaku Gothic ProN', メイリオ, Meiryo, sans-serif; 
}

.chatbot-container {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100%;
    background: white;
}

.chatbot-messages { 
    flex: 1; 
    overflow-y: auto; 
    padding: 20px; 
    background: var(--chat-bg); 
}

.message-container { 
    display: flex; 
    gap: 10px; 
    margin-bottom: 15px; 
    animation: fadeIn 0.3s ease; 
    align-items: flex-start; 
}

.message-container.user { 
    justify-content: flex-end;
    align-items: flex-end;
}
.message-container.bot { 
    justify-content: flex-start; 
}

.bot-avatar { 
    width: 40px; 
    height: 40px; 
    border-radius: 50%; 
    background: var(--bot-color); 
    color: white; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    font-size: 20px; 
    flex-shrink: 0; 
    overflow: hidden; 
}

.bot-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.bot-message-wrapper { 
    display: flex; 
    flex-direction: column; 
    align-items: flex-start; 
    max-width: 80%; 
}

.bot-name { 
    font-size: 12px; 
    color: #666; 
    margin-bottom: 4px; 
    font-weight: 500; 
}

.message { 
    position: relative; 
    padding: 12px 16px; 
    border-radius: 18px; 
    word-wrap: break-word; 
    box-shadow: 0 1px 2px rgba(0,0,0,0.1); 
    line-height: 1.5; 
}

.user-message { 
    background-color: var(--user-message-bg); 
    color: var(--user-message-text-color); 
    border-radius: 18px 18px 5px 18px; 
    max-width: 100%;
}

.bot-message { 
    background-color: var(--bot-message-bg); 
    color: var(--bot-message-text-color); 
    border-radius: 5px 18px 18px 18px; 
    border: 1px solid #e0e0e0; 
}

.read-indicator {
    font-size: 12px;
    color: #888;
    white-space: nowrap;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    margin-right: 5px;
    padding-bottom: 5px;
}

.read-indicator .read-timestamp {
    font-size: 11px;
}

.loading-message { 
    background-color: var(--thinking-message-bg); 
    display: flex; 
    gap: 4px; 
    padding: 12px 20px; 
}
.loading-message span { 
    animation: pulse 1.4s infinite; 
}
.loading-message span:nth-child(2) { 
    animation-delay: 0.2s; 
}
.loading-message span:nth-child(3) { 
    animation-delay: 0.4s; 
}

.message-timestamp {
    display: none;
}

.copy-btn { 
    background-color: #f0f0f0; 
    border: 1px solid #e0e0e0; 
    border-radius: 15px; 
    padding: 5px 12px; 
    font-size: 12px; 
    cursor: pointer; 
    transition: all 0.2s ease; 
    color: #555; 
    margin-top: 8px; 
}
.copy-btn:hover { 
    background-color: #e0e0e0; 
}

.rating-wrapper {
    margin-top: 8px;
    font-size: 13px;
    color: #555;
}

.rating-container {
    display: flex;
    align-items: center;
    gap: 8px;
}

.rating-star { 
    cursor: pointer; 
    font-size: 18px; 
    color: #ccc; 
    transition: color 0.2s; 
    user-select: none; 
}
.rating-star:hover { 
    color: #ffd700; 
}

.rating-thanks {
    font-size: 12px;
    color: #666;
    padding-top: 4px;
}

.suggestions-container { 
    display: flex; 
    flex-wrap: wrap; 
    gap: 8px; 
    margin-bottom: 15px; 
    padding: 0 5px; 
}

.suggestion-btn { 
    background-color: white; 
    border: 1px solid var(--bot-color); 
    border-radius: 20px; 
    padding: 8px 16px; 
    font-size: 13px; 
    cursor: pointer; 
    transition: all 0.2s ease; 
    color: var(--bot-color); 
}
.suggestion-btn:hover { 
    background-color: var(--bot-color); 
    color: white; 
}

.chatbot-input-area { 
    padding: 15px; 
    background: white; 
    border-top: 1px solid #e0e0e0;
    position: relative; /* オーバーレイの基準点 */
}

/*修正: メインコンテナ - 縦に要素を配置 (ファイル添付機能削除) */
.main-input-container {
    display: flex;
    flex-direction: column;
    gap: 10px; /* 第1行と第2行の間のスペース */
    margin-bottom: 10px;
}

/*修正: 第1行 - ファイル添付がなくなったため、入力ヒントが全幅を使用 */
.top-row-wrapper {
    display: flex;
    align-items: center; 
    gap: 10px;
}

.input-hint-section {
    flex-grow: 1; /* 残りのスペースをヒントが占める */
}

/*修正: 第2行 - テキストエリアと送信ボタンのラッパー */
.bottom-row-wrapper {
    display: flex;
    align-items: flex-end;
}

/*修正: 入力ヒントのスタイル - 中央揃えに調整 */
.input-hint {
    font-size: 11px;
    color: #999;
    text-align: center; /*修正 */
    margin-bottom: 0;
}
.input-hint .hint-text {
    background-color: #f0f0f0;
    padding: 5px 8px; /* パディングを調整 */
    border-radius: 4px;
    display: inline-block;
    white-space: nowrap; 
}
.input-hint kbd {
    background-color: #fff;
    border: 1px solid #ccc;
    border-radius: 3px;
    padding: 1px 4px;
    font-size: 10px;
    box-shadow: 0 1px 1px rgba(0,0,0,0.1);
}

/*修正: 個人情報同意エリアのスタイル */
.privacy-consent-area {
    display: flex;
    align-items: center;
    justify-content: flex-start; 
    gap: 8px;
    margin-bottom: 15px;
    padding: 10px;
    background-color: #fff3cd; 
    border: 1px solid #ffeeba;
    border-radius: 8px;
    font-size: 13px;
    color: #856404;
}

/*修正: ラベル全体はクリックイベントを無効化 */
.privacy-consent-area label {
    cursor: default; 
    pointer-events: none; 
}

/*追加: ラベル内のリンクのみを強制的にクリック可能にする */
.privacy-consent-area label a {
    pointer-events: auto; 
    cursor: pointer;
    text-decoration: underline; /* リンクであることを明示 */
    color: #856404; /* 親要素の色を維持 */
}

.privacy-consent-area input[type="checkbox"] {
    /* チェックボックス自体はクリック可能にする */
    pointer-events: auto; 
    cursor: pointer;
}

/*修正: 入力無効化オーバーレイ (変更なし) */
.input-disabled-overlay {
    position: absolute;
    left: 0;
    width: 100%;
    /* topとheightはscript.jsで動的に制御 */
    background-color: rgba(255, 255, 255, 0.7);
    z-index: 100;
    cursor: not-allowed;
    display: none; 
}

.input-wrapper { 
    display: flex; 
    gap: 10px; 
    align-items: flex-end; 
    flex-grow: 1; 
}

#chatInput { 
    flex: 1; 
    border: 1px solid #e0e0e0; 
    border-radius: 20px; 
    font-size: 14px; 
    outline: none; 
    transition: border-color 0.3s ease; 
    padding: 10px 15px; 
    resize: none; 
    max-height: 100px; 
    overflow-y: auto; 
}
#chatInput:focus { 
    border-color: var(--bot-color); 
}
#chatInput:disabled { 
    background-color: #f8f9fa; 
    color: #999; 
}

.send-btn { 
    background: var(--bot-color); 
    color: white; 
    border: none; 
    border-radius: 8px; 
    padding: 10px 16px; 
    font-size: 14px; 
    font-weight: 600; 
    cursor: pointer; 
    transition: all 0.3s ease; 
    flex-shrink: 0; 
}
.send-btn:hover:not(:disabled) { 
    filter: brightness(90%); 
}
.send-btn:disabled { 
    opacity: 0.5; 
    cursor: not-allowed; 
    background: #6c757d; 
}

.ai-disclaimer { 
    font-size: 11px; 
    color: #999; 
    text-align: center; 
    margin-top: 10px; 
}

@keyframes fadeIn { 
    from { opacity: 0; transform: translateY(10px); } 
    to { opacity: 1; transform: translateY(0); } 
}
@keyframes pulse { 
    0%, 60%, 100% { opacity: 0.3; } 
    30% { opacity: 1; } 
}

.hidden { 
    display: none !important; 
}

.bot-message p:first-child { 
    margin-top: 0; 
}
.bot-message p:last-child { 
    margin-bottom: 0; 
}
.bot-message ul, .bot-message ol { 
    padding-left: 20px; 
}

.contact-info {
    font-size: 11px;
    color: #555;
    text-align: center;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #f0f0f0;
}
.contact-info a {
    color: var(--bot-color);
    text-decoration: none;
}
.contact-info a:hover {
    text-decoration: underline;
}

/* メディアクエリを追加してモバイル対応を強化 */
@media (max-width: 600px) {
    /* チャットボット全体をフルスクリーンにする */
    #chatbot-wrapper {
        top: 0 !important;
        left: 0 !important;
        width: 100% !important;
        height: 100% !important;
        max-width: none !important;
        max-height: none !important;
        border-radius: 0 !important;
        box-shadow: none !important;
        transition: transform 0.3s ease-in-out;
    }
    
    /* ドラッグ＆リサイズハンドルを非表示にする */
    #chatbot-wrapper > div[data-direction] {
        display: none !important;
    }

    /* ヘッダーのスタイルを調整 */
    #chatbot-external-header {
        font-size: 18px;
        padding: 12px 15px;
    }

    /* ランチャーボタンのスタイルを調整 */
    .chat-toggle-btn {
        padding: 12px 24px;
        font-size: 16px;
    }
}