/* ===== AIチャット全体 ===== */
#ai-box {
    max-width: 600px;
    margin: 30px auto;
    border: 1px solid #ccc;
    border-radius: 10px;
    padding: 16px;
    background: #fafafa;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* ===== ログ部分 ===== */
#ai-log {
    min-height: 300px;
    max-height: 600px;
    overflow-y: auto;
    padding: 10px;
    background: #fff;
    border-radius: 8px;
    border: 1px solid #ddd;
    font-size: 15px;
    line-height: 1.6;
}

/* ===== 入力フォーム ===== */
#ai-form {
    display: flex;
    gap: 10px;
    align-items: stretch;
}

#ai-q {
    flex: 1;
    min-height: 80px;
    resize: vertical;
    padding: 10px;
    font-size: 15px;
    border-radius: 6px;
    border: 1px solid #ccc;
}

#ai-form button {
    min-width: 80px;
    background: #1976d2;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 15px;
    cursor: pointer;
}
#ai-form button:hover {
    background: #1565c0;
}

/* ===== ユーザーの発言 ===== */
.ai-user {
    text-align: right;
    color: #1976d2;
    margin: 4px 0;
}

/* ===== AIの発言 ===== */
.ai-bot {
    position: relative;
    background: #e3f2fd;
    padding: 12px 14px;
    border-radius: 8px;
    margin: 6px 0;
    display: inline-block;
    max-width: 90%;
}

/* ===== AIテキスト ===== */
.ai-text {
    white-space: normal;
    word-break: break-word;
    line-height: 1.6;
    font-size: 15px;
    color: #333;
    padding-right: 60px; /* コピーアイコン分 */
}

/* Markdown対応 */
.ai-text strong { font-weight: bold; color: #000; }
.ai-text em { font-style: italic; color: #555; }
.ai-text ul { margin: 6px 0 6px 18px; padding: 0; }
.ai-text h1, .ai-text h2, .ai-text h3 {
    margin: 8px 0 4px;
    font-weight: bold;
    color: #1976d2;
}

/* ===== コピーアイコン ===== */
.ai-copy {
    position: absolute;
    right: 6px;
    top: 6px;
    font-size: 12px;
    background: #1976d2;
    color: #fff;
    border: none;
    border-radius: 4px;
    padding: 2px 6px;
    cursor: pointer;
    opacity: 0.8;
}
.ai-copy:hover { opacity: 1; }

/* ===== モデル情報・免責 ===== */
#ai-model-info {
    text-align: right;
    font-size: 0.85em;
    color: #666;
    margin-top: 4px;
}
#ai-disclaimer {
    font-size: 0.8em;
    color: #888;
    margin-top: 6px;
}
