/* * ==========================================
 * Business Mail AI Tools - Common Styles
 * Theme Color: #1629CC (Matching resize.ctp)
 * ==========================================
 */

 .bm-main-wrapper { 
    max-width: 1200px; 
    margin: 0 auto; 
    padding-bottom: 40px; 
}

/* H1 タイトル (resize.ctp準拠) */
.bm-h1-title {
    font-size: 24px; 
    font-weight: bold; 
    color: #1629CC; 
    border-bottom: 2px solid #1629CC; 
    padding-bottom: 8px; 
    margin-bottom: 20px; 
    background-color: transparent !important; 
    background-image: none !important; 
    position: static !important; 
    text-align: center; 
    line-height: 1.4;
}
.bm-h1-title span {
    background-color: transparent; 
    word-break: break-word;
}

/* 緑色のインフォメーションボックス (resize.ctp準拠) */
.bm-info-box {
    background: #ecfdf5; 
    color: #065f46; 
    padding: 12px 18px; 
    border-radius: 8px; 
    font-size: 14px; 
    margin-bottom: 25px; 
    border: 1px solid #a7f3d0; 
    display: flex; 
    align-items: flex-start; 
    gap: 10px; 
    width: 100%;
    box-sizing: border-box;
}

/* 入力エリア */
.bm-input-area { 
    background: #fff; 
    padding: 25px; 
    border-radius: 12px; 
    box-shadow: 0 10px 25px rgba(0,0,0,0.05); 
    border: 1px solid #e2e8f0;
    margin-bottom: 25px; 
}

.bm-form-group { margin-bottom: 20px; }
.bm-form-group label { 
    display: block; 
    font-size: 13px; 
    color: #64748b; 
    margin-bottom: 6px; 
    font-weight: bold; 
}

.bm-options-row { display: flex; gap: 15px; flex-wrap: wrap; }
.bm-options-row > div { flex: 1; min-width: 200px; }

/* フォーム部品 (resize.ctp準拠) */
.bm-input-area select, 
.bm-input-area input[type="text"], 
.bm-input-area textarea { 
    width: 100%; 
    padding: 12px; 
    border: 2px solid #cbd5e1; 
    border-radius: 6px; 
    font-size: 15px; 
    color: #1e293b; 
    background-color: #fff; 
    box-sizing: border-box; 
    outline: none; 
    transition: 0.2s;
}
.bm-input-area select:focus, 
.bm-input-area input[type="text"]:focus, 
.bm-input-area textarea:focus { 
    border-color: #1629CC; 
}
.bm-input-area textarea { height: 140px; resize: vertical; }

/* アコーディオンメニュー (折りたたみ) */
.bm-details { 
    background: #f8fafc; 
    border-radius: 8px; 
    padding: 12px 15px; 
    margin-bottom: 15px; 
    border: 1px solid #e2e8f0;
}
.bm-details summary { 
    font-weight: bold; 
    color: #475569; 
    cursor: pointer; 
    outline: none; 
    list-style: none; 
    display: flex; 
    align-items: center;
    font-size: 14px;
}
.bm-details summary::-webkit-details-marker { display: none; }
.bm-details summary::after { 
    content: '▼'; 
    font-size: 12px; 
    margin-left: auto; 
    color: #94a3b8; 
    transition: 0.3s;
}
.bm-details[open] summary::after { transform: rotate(180deg); }
.bm-details-content { 
    margin-top: 15px; 
    border-top: 1px dashed #cbd5e1; 
    padding-top: 15px;
}
.bm-opt-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }
@media (max-width: 600px) { .bm-opt-grid { grid-template-columns: 1fr; } }

/* 利用回数情報 */
.bm-limit-info { 
    text-align: center; 
    font-size: 14px; 
    color: #64748b; 
    margin-bottom: 15px; 
    font-weight: bold; 
}
.bm-limit-info strong { color: #1629CC; font-size: 18px; padding: 0 4px; }

/* 実行ボタン (resize.ctp準拠) */
.bm-btn-submit { 
    width: 100%; 
    background: #1629CC; 
    color: #fff; 
    border: none; 
    padding: 16px; 
    border-radius: 8px; 
    font-size: 18px; 
    font-weight: bold; 
    cursor: pointer; 
    transition: 0.2s; 
    box-shadow: 0 4px 12px rgba(22, 41, 204, 0.3);
}
.bm-btn-submit:hover { 
    background: #101e99; 
    transform: translateY(-1px); 
}
.bm-btn-submit:disabled { 
    background: #cbd5e1 !important; 
    color: #64748b !important; 
    cursor: not-allowed !important; 
    box-shadow: none !important; 
    transform: none !important;
}

/* 結果表示エリア */
.bm-result-section { 
    background: #fff; 
    padding: 30px; 
    border-radius: 12px; 
    border: 2px solid #1629CC; 
    box-shadow: 0 10px 25px rgba(22, 41, 204, 0.1); 
    margin-top: 30px; 
    animation: bmFadeIn 0.5s ease-out;
}
.bm-result-section h3 { 
    color: #1629CC; 
    margin-top: 0; 
    border-bottom: 1px solid #e2e8f0; 
    padding-bottom: 10px; 
    margin-bottom: 20px;
}

/* 生成されたメール文 (必ず左寄せ) */
.bm-ai-output-box { 
    background: #f8fafc; 
    padding: 20px; 
    border-radius: 8px; 
    border: 1px solid #e2e8f0; 
    font-family: 'Yu Gothic', 'Meiryo', sans-serif; 
    font-size: 15px; 
    line-height: 1.8; 
    color: #1e293b; 
    white-space: pre-wrap; 
    margin-bottom: 20px;
    text-align: left !important; /* Outlook等のため強制的に左寄せ */
}

.bm-btn-copy { 
    width: 100%; 
    padding: 14px; 
    background: #1e293b; 
    color: #fff; 
    border: none; 
    border-radius: 8px; 
    font-size: 16px; 
    font-weight: bold; 
    cursor: pointer; 
    transition: 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}
.bm-btn-copy:hover { background: #0f172a; }

@keyframes bmFadeIn { 
    from { opacity: 0; transform: translateY(10px); } 
    to { opacity: 1; transform: translateY(0); } 
}



/* * ==========================================
 * Business Mail AI Tools - Modal & SEO Content
 * ==========================================
 */

/* SEO コンテンツ用スタイル */
.bm-seo-section {
    background: #fff;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
    border: 1px solid #e2e8f0;
    margin-bottom: 30px;
    color: #334155;
    line-height: 1.7;
}
.bm-seo-section h2 {
    font-size: 20px;
    color: #1629CC;
    border-bottom: 2px solid #e2e8f0;
    padding-bottom: 12px;
    margin-top: 0;
    margin-bottom: 20px;
}
.bm-seo-section h3 {
    font-size: 17px;
    color: #0f172a;
    margin-top: 30px;
    margin-bottom: 15px;
    border-left: 4px solid #1629CC;
    padding-left: 12px;
}
.bm-seo-section p { margin-bottom: 15px; }

/* テンプレートリンク（ポップアップトリガー） */
.bm-template-list {
    list-style: none;
    padding: 0;
    margin: 0;
}
.bm-template-list li {
    margin-bottom: 12px;
    position: relative;
    padding-left: 20px;
}
.bm-template-list li::before {
    content: "📄";
    position: absolute;
    left: 0;
    top: 0px;
    font-size: 14px;
}
.bm-template-list a {
    color: #1629CC;
    text-decoration: none;
    border-bottom: 1px dashed #1629CC;
    cursor: pointer;
    font-weight: 500;
    transition: 0.2s;
}
.bm-template-list a:hover {
    color: #101e99;
    border-bottom-style: solid;
    background: #f8fafc;
}

/* モーダルウィンドウ（ポップアップ） */
.bm-modal-overlay {
    position: fixed; 
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(15, 23, 42, 0.6); 
    z-index: 1000;
    display: none; 
    justify-content: center; 
    align-items: center;
    opacity: 0; 
    transition: opacity 0.2s ease;
}
.bm-modal-overlay.active { 
    display: flex; 
    opacity: 1; 
}
.bm-modal-content {
    background: #fff; 
    width: 90%; 
    max-width: 650px;
    border-radius: 12px; 
    padding: 30px; 
    box-shadow: 0 20px 25px -5px rgba(0,0,0,0.1);
    position: relative; 
    max-height: 85vh; 
    overflow-y: auto;
}
.bm-modal-close {
    position: absolute; 
    top: 15px; right: 15px; 
    background: #f1f5f9;
    border: none; 
    font-size: 20px; 
    width: 36px; height: 36px; 
    border-radius: 50%;
    cursor: pointer; 
    color: #64748b; 
    display: flex; 
    align-items: center; 
    justify-content: center;
    transition: 0.2s;
}
.bm-modal-close:hover { 
    background: #e2e8f0; 
    color: #0f172a; 
}
.bm-modal-title {
    font-size: 18px;
    color: #1629CC;
    font-weight: bold;
    margin-bottom: 20px;
    padding-right: 30px;
    border-bottom: 1px solid #e2e8f0;
    padding-bottom: 10px;
}
.bm-modal-body {
    font-family: 'Yu Gothic', 'Meiryo', sans-serif; 
    background: #f8fafc;
    padding: 20px;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    white-space: pre-wrap;
    font-size: 14px;
    line-height: 1.8;
}

/* FAQスタイル */
.bm-faq-item { margin-bottom: 20px; }
.bm-faq-q { font-weight: bold; color: #1629CC; margin-bottom: 8px; display: flex; align-items: flex-start; }
.bm-faq-q::before { content: "Q."; margin-right: 8px; font-weight: bold; }
.bm-faq-a { display: flex; align-items: flex-start; color: #475569; }
.bm-faq-a::before { content: "A."; color: #e53e3e; margin-right: 8px; font-weight: bold; }



/* * ==========================================
 * Business Mail AI Tools - UI Components
 * Step Badges (步骤序号) & Quick Tags (快捷填词标签)
 * ==========================================
 */

/* --- 1. ステップ番号（序号）のスタイル --- */
.bm-step-badge {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    width: 22px;
    height: 22px;
    background-color: #ffffff;
    color: #475569; /* ★ 初期色は普通フォントと同じグレー */
    border: 1px solid #94a3b8;
    border-radius: 2px; /* ★ 円形ではなく方形（スクエア） */
    font-size: 12px;
    font-weight: bold;
    margin-right: 8px;
    transition: all 0.3s ease;
}
/* ★ 該当の入力エリア（selectやtextarea）が選択（フォーカス）された時だけ色が変わる */
.bm-form-group:focus-within .bm-step-badge {
    background-color: #1629CC;
    color: #ffffff;
    border-color: #1629CC;
}
.bm-form-group label {
    display: flex; 
    align-items: center;
}

/* --- 2. クイック入力タグ（5つのボタン）のスタイル --- */
.bm-quick-tags-wrapper {
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}
.bm-quick-tags-label {
    font-size: 13px;
    color: #475569;
    font-weight: bold;
    margin-bottom: 0; 
    display: flex; 
    align-items: center;
}
.bm-quick-tags-req {
    color: #e53e3e; /* 必須の赤字 */
}
.bm-quick-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.bm-tag-btn {
    background: #ffffff;
    color: #475569; /* ★ 初期色は普通フォントと同じグレー */
    border: 1px solid #cbd5e1;
    padding: 7px 14px;
    border-radius: 2px;  /* ★ 楕円ではなく方形（スクエア） */
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}
.bm-tag-btn:hover {
    background: #f8fafc;
    border-color: #94a3b8;
}
/* ★ ユーザーがそのボタンを選択した時だけブランドカラー（ブルー）に変わる */
.bm-tag-btn.active {
    background: #1629CC;
    color: #ffffff;
    border-color: #1629CC;
    box-shadow: 0 2px 4px rgba(22, 41, 204, 0.2);
}
.bm-tag-error {
    color: #e53e3e;
    font-size: 13px;
    font-weight: bold;
    margin-top: 4px;
    display: none;
    width: 100%;
}



/* --- 3. 宛先トグル（社内/社外 選択ラジオボタン）のスタイル --- */
.bm-radio-group {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}
.bm-radio-wrapper {
    flex: 1;
    cursor: pointer;
}
.bm-radio-wrapper input[type="radio"] {
    /* display: none; は使わない！ */
    display: inline-block !important;
    position: absolute;
    opacity: 0;
    width: 1px;
    height: 1px;
    z-index: -1;
}
.bm-radio-btn {
    display: block;
    background: #ffffff;
    color: #475569;
    border: 1px solid #cbd5e1;
    padding: 12px 16px;
    border-radius: 2px; /* スクエア形状 */
    font-size: 14px;
    font-weight: bold;
    text-align: center;
    transition: all 0.2s ease;
}
.bm-radio-wrapper:hover .bm-radio-btn {
    background: #f8fafc;
    border-color: #94a3b8;
}
/* ★ 選択された時のスタイル（input:checkedと隣接セレクタ+を利用） */
.bm-radio-wrapper input[type="radio"]:checked + .bm-radio-btn {
    background: #1629CC;
    color: #ffffff;
    border-color: #1629CC;
    box-shadow: 0 2px 4px rgba(22, 41, 204, 0.2);
}


/* =========================================================
   追加修正：スマホ版での生成結果エリアの左右の余白（空白）を削減
========================================================= */
@media (max-width: 600px) {
    .bm-ai-output-box,
    .response-content {
        padding: 15px 12px !important;
    }
    /* ★ 追加：外枠（bm-result-section）の余白も削減 */
    .bm-result-section {
        padding: 15px 12px !important;
    }
}


/* =========================================================
   Hubページ（一覧/ポータル）専用スタイル
========================================================= */
.bm-hub-controls { display: flex; justify-content: space-between; align-items: center; margin-bottom: 25px; flex-wrap: wrap; gap: 15px; }

/* カテゴリタブ */
.bm-hub-tabs { display: flex; gap: 10px; }
.bm-hub-tab { padding: 8px 16px; background: #fff; border: 1px solid #cbd5e1; border-radius: 20px; font-size: 14px; font-weight: bold; color: #475569; cursor: pointer; transition: 0.2s; }
.bm-hub-tab:hover { background: #f1f5f9; }
.bm-hub-tab.active { background: #1629CC; color: #fff; border-color: #1629CC; box-shadow: 0 2px 6px rgba(22, 41, 204, 0.2); }

/* 表示切り替えボタン（カード/リスト） */
.bm-view-toggle { display: flex; background: #f1f5f9; border-radius: 6px; padding: 4px; border: 1px solid #e2e8f0; }
.bm-view-btn { padding: 6px 12px; background: transparent; border: none; border-radius: 4px; color: #64748b; cursor: pointer; font-size: 13px; font-weight: bold; display: flex; align-items: center; gap: 6px; transition: 0.2s; }
.bm-view-btn svg { width: 16px; height: 16px; fill: currentColor; }
.bm-view-btn.active { background: #fff; color: #1629CC; box-shadow: 0 1px 3px rgba(0,0,0,0.1); }

/* グリッドレイアウト（デフォルト：カード型） */
.bm-hub-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 20px; margin-bottom: 40px; }
.bm-hub-group-title { grid-column: 1 / -1; font-size: 18px; color: #1e293b; border-bottom: 2px solid #e2e8f0; padding-bottom: 8px; margin-top: 10px; margin-bottom: 5px; }

/* カード自体のデザイン */
.bm-hub-card { background: #fff; border: 1px solid #e2e8f0; border-radius: 8px; padding: 20px; display: flex; flex-direction: column; transition: all 0.2s ease; text-decoration: none; box-shadow: 0 2px 4px rgba(0,0,0,0.02); }
.bm-hub-card:hover { transform: translateY(-3px); box-shadow: 0 8px 15px rgba(22, 41, 204, 0.1); border-color: #c7d2fe; }
.bm-hub-card-icon { font-size: 28px; margin-bottom: 12px; }
.bm-hub-card-title { font-size: 16px; font-weight: bold; color: #1e293b; margin-bottom: 8px; }
.bm-hub-card-desc { font-size: 13px; color: #64748b; line-height: 1.5; flex-grow: 1; }

/* リストレイアウト（切り替え時） */
.bm-hub-container.view-list .bm-hub-grid { display: flex; flex-direction: column; gap: 10px; }
.bm-hub-container.view-list .bm-hub-card { flex-direction: row; align-items: center; padding: 15px 20px; }
.bm-hub-container.view-list .bm-hub-card-icon { margin-bottom: 0; margin-right: 15px; font-size: 24px; }
.bm-hub-container.view-list .bm-hub-card-title { margin-bottom: 0; width: 220px; flex-shrink: 0; }
.bm-hub-container.view-list .bm-hub-card-desc { margin-bottom: 0; }

@media (max-width: 600px) {
    .bm-hub-controls { flex-direction: column; align-items: flex-start; }
    .bm-hub-container.view-list .bm-hub-card { flex-direction: column; align-items: flex-start; }
    .bm-hub-container.view-list .bm-hub-card-icon { margin-bottom: 8px; }
    .bm-hub-container.view-list .bm-hub-card-title { width: 100%; margin-bottom: 4px; }
}