/* ==================================================
   menu_layout2.css (v2 完全リセット・装飾のみ)
   ================================================== */

/* --------------------------------------------------
   0. サイドバー上部の位置調整
   ★カクさんの指定通り、これだけで調整します
   -------------------------------------------------- */
.generator-top .sidemenu .new-analysis-button {
    padding-bottom: 27px !important;
}


/* --------------------------------------------------
   1. 選択したものの強調 (文字色のみ・位置ズレなし)
   -------------------------------------------------- */
/* (A) キーワード単体 */
.generator-top .sidemenu .history-keyword-item.active {
    color: var(--variable-collection-lighttext-primary) !important;
    font-weight: 600;
}
.generator-top .sidemenu .history-keyword-item.active a {
    color: inherit !important;
}

/* (B) グループ行 */
.generator-top .sidemenu .frame-3 summary.active,
.generator-top .sidemenu a.frame-6.active {
    color: var(--variable-collection-lighttext-primary) !important;
    font-weight: 600;
}

/* 文字色継承 */
.generator-top .sidemenu .frame-3 summary.active a,
.generator-top .sidemenu .frame-3 summary.active + ul.frame-5 a,
.generator-top .sidemenu a.frame-6.active time {
    color: inherit !important;
}

/* 新しい分析ボタン */
.generator-top .sidemenu .new-analysis-button.active {
   /* background-color: #E6E6E6 !important;*/
    color: var(--variable-collection-lighttext-primary) !important;
    border-radius: 4px;
}

/* ダークモード対応 */
[data-theme="dark"] .generator-top .sidemenu .history-keyword-item.active,
[data-theme="dark"] .generator-top .sidemenu .frame-3 summary.active,
[data-theme="dark"] .generator-top .sidemenu a.frame-6.active,
[data-theme="dark"] .generator-top .sidemenu .new-analysis-button.active {
    color: var(--variable-collection-text-primary) !important;
}
[data-theme="dark"] .generator-top .sidemenu .new-analysis-button.active {
    background-color: rgba(255, 255, 255, 0.15) !important;
}


/* --------------------------------------------------
   (その他) アイコン・矢印・ケバブメニュー等
   -------------------------------------------------- */

/* 矢印 (CSS描画) */
.generator-top .sidemenu .frame-4 .img { display: none !important; }
.generator-top .sidemenu .frame-3 summary::before {
    content: ""; display: inline-block; width: 6px; height: 6px;
    border-right: 2px solid var(--variable-collection-lighttext-secondary);
    border-bottom: 2px solid var(--variable-collection-lighttext-secondary);
    margin-right: 12px; margin-left: 4px; flex-shrink: 0; transition: transform 0.2s ease;
}
.generator-top .sidemenu details:not([open]) > summary::before { transform: rotate(-45deg) !important; }
.generator-top .sidemenu details[open] > summary::before { transform: rotate(45deg) !important; }
[data-theme="dark"] .generator-top .sidemenu .frame-3 summary::before { border-color: var(--variable-collection-text-secondary); }

/* アイコン追加 */
.new-analysis-button::before {
    content: ""; display: inline-block; width: 18px; height: 18px;
    background-image: url('/assets/img/common/plus_circle.png');
    background-repeat: no-repeat; background-position: center; background-size: contain;
    margin-right: 8px; vertical-align: middle; opacity: 0.9;
}
.generator-top .sidemenu .project h2.text-wrapper-3::before {
    content: ""; display: inline-block; width: 18px; height: 18px;
    background-image: url('/assets/img/common/folder.png');
    background-repeat: no-repeat; background-position: center; background-size: contain;
    margin-right: 8px; vertical-align: text-bottom; opacity: 0.9;
}
.generator-top .sidemenu .history h2.text-wrapper-3::before {
    content: ""; display: inline-block; width: 18px; height: 18px;
    background-image: url('/assets/img/common/Clock.png');
    background-repeat: no-repeat; background-position: center; background-size: contain;
    margin-right: 8px; vertical-align: text-bottom; opacity: 0.9;
}
[data-theme="dark"] .new-analysis-button::before,
[data-theme="dark"] .generator-top .sidemenu .project h2.text-wrapper-3::before,
[data-theme="dark"] .generator-top .sidemenu .history h2.text-wrapper-3::before { filter: invert(1) brightness(2); }

/* Topへ戻るボタン */
#scrollTopBtn {
    position: fixed; bottom: 110px; right: 30px; z-index: 999;
    width: 44px; height: 44px; border-radius: 50%;
    background-color: var(--variable-collection-lightbackground-main);
    border: 1px solid var(--variable-collection-lightline-default);
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    display: flex; align-items: center; justify-content: center; cursor: pointer;
    opacity: 0; pointer-events: none; transition: opacity 0.3s ease, transform 0.3s ease;
}
#scrollTopBtn.show { opacity: 1; pointer-events: auto; }
#scrollTopBtn:hover { background-color: #f8f9fa; transform: translateY(-2px); }
#scrollTopBtn::after {
    content: ""; display: block; width: 10px; height: 10px;
    border-top: 2px solid var(--variable-collection-lighttext-primary);
    border-right: 2px solid var(--variable-collection-lighttext-primary);
    transform: rotate(-45deg); margin-top: 4px;
}
[data-theme="dark"] #scrollTopBtn { background-color: var(--variable-collection-background-main); border-color: var(--variable-collection-line-default); }
[data-theme="dark"] #scrollTopBtn::after { border-color: var(--variable-collection-text-primary); }

/* ケバブメニュー (影付き) */
.generator-top .sidemenu .kebab-menu {
    background-color: #FFFFFF !important;
    border: 1px solid var(--variable-collection-lightline-mute) !important;
    border-radius: 8px !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15) !important;
    padding: 8px 0 !important; min-width: 160px !important;
    z-index: 1000 !important;
}
.generator-top .sidemenu .kebab-menu a {
    display: block !important; padding: 10px 16px !important;
    color: var(--variable-collection-lighttext-primary) !important;
    font-size: 14px !important; font-weight: 500 !important; text-decoration: none !important;
    transition: background-color 0.2s ease;
}
.generator-top .sidemenu .kebab-menu a:hover { background-color: #F5F5F5 !important; }
.generator-top .sidemenu .kebab-menu hr {
    margin: 4px 0 !important; border: none !important;
    border-top: 1px solid var(--variable-collection-lightline-mute) !important;
}
[data-theme="dark"] .generator-top .sidemenu .kebab-menu {
    background-color: var(--variable-collection-background-secondary) !important;
    border-color: var(--variable-collection-line-mute) !important;
}
[data-theme="dark"] .generator-top .sidemenu .kebab-menu a { color: var(--variable-collection-text-primary) !important; }
[data-theme="dark"] .generator-top .sidemenu .kebab-menu a:hover { background-color: rgba(255, 255, 255, 0.1) !important; }

/* ========================================
   サイト全体のフォントをゴシック体に強制統一
   ======================================== */
body, 
body *:not(.fa):not(.fas):not(.far):not(.fab):not([class*="icon-"]) {
    font-family: "Helvetica Neue", Arial, "Hiragino Kaku Gothic ProN", "Hiragino Sans", Meiryo, sans-serif !important;
}
/* ※もしアイコンが□（豆腐）になったら、そのアイコンのクラスを :not() に追加します */

/* ★FontAwesomeをゴシック化から確実に守るための防波堤（バージョン6対応版！） */
.fa, .fas, .far, .fab {
    font-family: "Font Awesome 6 Free", "Font Awesome 5 Free", "FontAwesome" !important;
}
.fas { font-weight: 900 !important; }
.far { font-weight: 400 !important; }

/* ========================================
   プロジェクト・履歴メニュー周りのレイアウト調整
   （menu.php のインラインスタイルをCSS化）
   ======================================== */
/* 新しい分析（小）のリンク */
.new-analysis-small-link {
    text-decoration: none;
    display: block;
}

/* プロジェクトH2と追加ボタンのラッパー */
.project-header-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

/* 新規プロジェクト追加ボタン */
#openAddProjectModalBtn {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
}

/* ケバブメニュー内のSVG */
.kebab-menu-button svg {
    display: block;
}

/* プロジェクト名 (太字解除) */
.project-group-link {
    font-weight: normal;
}

/* フォルダ一覧のインデント */
.project-folder-list {
    padding-left: 15px !important;
}

/* キーワード一覧のインデント */
.project-keyword-list {
    padding-left: 10px !important;
}

/* 空のテキスト用 */
.empty-keyword-text {
    color: #999 !important;
}
.empty-folder-text {
    color: var(--variable-collection-lighttext-secondary) !important;
}

/* ========================================
   プロジェクト名のホバー時の「一覧表示」ボタン (潰れ対策・絶対配置版)
   ======================================== */
.project-group-summary {
    position: relative;
}

.project-view-all-btn {
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
    
    /* ★ フレックスボックスの押し合いを避けるため絶対配置で強制的に置く！ */
    position: absolute;
    right: 32px; /* ケバブメニューの左隣あたりに浮かせる */
    top: 50%;
    transform: translateY(-50%);
    
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4px;
    color: var(--variable-collection-lighttext-secondary);
    z-index: 10;
}

.project-view-all-btn:hover {
    color: var(--variable-collection-lighttext-primary);
}

/* ホバーした瞬間にフワッと出す！ */
.project-group-summary:hover .project-view-all-btn {
    opacity: 1;
    visibility: visible;
}

/* ==========================================
   1. スマホ時にメニュー幅を減らす ＆ メインの余白・ヘッダー・文字調整
   ========================================== */
@media screen and (max-width: 820px) {
    /* メニュー幅を220pxに */
    .generator-top:not(.sidebar-closed) .sidemenu {
        width: 220px !important;
        min-width: 220px !important;
        max-width: 220px !important;
        flex-basis: 220px !important;
    }

    /* メイン画面の幅とマージン調整 */
    .generator-top:not(.sidebar-closed) .main {
        margin-left: 220px !important;
        width: calc(100% - 220px) !important;
        padding-right: 0 !important;
    }

    /* ★ここを強化！元の 84px の余白に負けないように確実に打ち消す！ */
    .generator-top:not(.sidebar-closed) .main .main-scroll-wrapper {
        padding-left: 10px !important;
        padding-right: 10px !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }

    /* ヘッダー位置のズレ修正 */
    .generator-top:not(.sidebar-closed) .main .TITLE {
        left: 220px !important;
        width: calc(100% - 220px) !important;
        padding-left: 10px !important;
        box-sizing: border-box !important;
    }

    /* 「どんな〜」を1行に収める */
    .generator-top:not(.sidebar-closed) .main .text-wrapper-11 {
        font-size: clamp(10px, 3.2vw, 22px) !important;
        white-space: nowrap !important;
        padding-left: 0 !important; 
        padding-right: 0 !important;
        box-sizing: border-box !important;
        width: 100% !important;
        text-align: center !important;
    }
    .generator-top .main .frame-7 {
		  margin-left: 55px;
		}
		/* メニューが開いている時だけ55pxを無効化して中央に戻す */
    .generator-top:not(.sidebar-closed) .main .frame-7 {
        margin-left: 0 !important;
    }
}

/* ==========================================
   アカウントプロフィール（MENU最下部）のスタイル
   ========================================== */

/* --- 1. アイコンの左下固定配置と履歴エリアとの干渉防止 --- */
.sidemenu {
    position: relative;
    padding-bottom: 80px !important; /* 履歴とアイコンが被らないよう下部に余白を確保 */
}

.simple-bottom-icon {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 0 !important;
    text-align: center;
    z-index: 100;
    background-color: #f7f7f7;
    border-top: 1px solid #ddd;
}

.simple-bottom-icon img {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: 1px solid #666;
    background-color: #fff;
    padding: 5px;
    object-fit: contain;
    flex-shrink: 0;
    box-sizing: border-box;
}

/* --- 2. ボタンの横並びとテキストのスタイル --- */
.account-profile-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none !important;
    color: #333 !important;
    padding: 5px 15px !important;
    border-radius: 8px;
    transition: background-color 0.2s ease;
    width: 100%;
    box-sizing: border-box;
}

.account-profile-btn:hover {
    background-color: rgba(0, 0, 0, 0.05);
}

.account-name-text {
    font-size: 13px !important;
    font-weight: 500;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    flex: 1 1 auto;
    text-align: left;
    line-height: 1 !important;
    margin-top: 2px !important;
}

/* --- 3. ポップアップメニューのスタイル --- */
.account-popup-menu {
    position: absolute;
    bottom: calc(100% + 8px);
    left: 10px; /* メニューの左余白 */
    width: calc(100% - 20px); /* サイドバー幅に合わせて可変にし、見切れを防止 */
    max-width: 230px; /* 最大幅を制限 */
    background: #d6d6d6; /* ★見本に合わせて濃いめのグレーに変更 */
    border: 1px solid #c8c8c8;
    border-radius: 24px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.15);
    padding: 10px 0; /* ★修正：メニュー全体の上下余白をゆったりめに戻す */
    z-index: 1000;
    text-align: left !important;
}

/* ==========================================
   ポップアップメニュー内アイテムのスタイル調整
   ========================================== */
.popup-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 16px !important; /* ★修正：基本の項目はゆったりした余白に戻す */
    margin: 0 !important;
    text-decoration: none !important;
    color: #222 !important;
    font-size: 14px;
    position: relative;
    line-height: 1.3;
    background-color: transparent !important;
    z-index: 1;
}

/* ★修正：「お知らせ(5番目)」「サービス情報(6番目)」「ヘルプ(7番目)」のみ余白を詰める */
.popup-item:nth-child(5),
.popup-item:nth-child(6),
.popup-item:nth-child(7) {
    padding: 3px 16px !important; 
}

/* 既存のホバー背景色を無効化 */
.popup-item:hover {
    background-color: transparent !important;
}

/* ホバー用の独立した背景レイヤーを生成 */
.popup-item::before {
    content: '';
    position: absolute;
    top: 1px;
    bottom: 1px; 
    left: 16px;
    right: 16px;
    border-radius: 6px;
    background-color: transparent;
    z-index: -1;
    transition: background-color 0.2s;
}

/* マウスオーバー時の背景色適用 */
.popup-item:hover::before {
    background-color: rgba(0, 0, 0, 0.08); 
}

/* アイテム間の区切り線（アンダーライン） */
.popup-item.border-bottom::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 16px;
    right: 16px;
    height: 1px;
    background-color: #a0a0a0;
}

/* コンテンツ要素をホバー背景の前面に維持 */
.item-main, .item-arrow {
    position: relative;
    z-index: 1;
}

/* テキストの縦配列とインデント */
.item-main {
    display: flex;
    flex-direction: column;
    padding-left: 10px;
}

/* サブテキストの設定（現在未使用だが構造維持のため残置） */
.item-sub {
    font-size: 12px;
    color: #555;
    margin-top: 1px;
}

/* 右側の矢印アイコン */
.item-arrow {
    font-size: 12px;
    color: #777;
    margin-left: 10px;
    padding-right: 6px;
}

/* ==========================================
   4. サイドバー閉合時のスタイル切り替え
   ========================================== */

/* テキストの非表示 */
.generator-top.sidebar-closed .account-name-text,
.sidebar-closed .account-name-text {
    display: none !important;
}

/* メニューボタンの背景色・罫線リセット */
.generator-top.sidebar-closed .simple-bottom-icon,
.sidebar-closed .simple-bottom-icon {
    border-top: none !important;
    background-color: transparent !important;
}

/* メニューボタンの中央配置 */
.generator-top.sidebar-closed .account-profile-btn,
.sidebar-closed .account-profile-btn {
    justify-content: center !important;
    padding: 5px 0 !important;
}

/* ポップアップメニューの配置（真上表示） */
.generator-top.sidebar-closed .account-popup-menu,
.sidebar-closed .account-popup-menu {
    left: 0px !important; 
    margin-left: 0 !important;
    bottom: calc(100% + 8px) !important;
    width: 230px !important; /* 閉合時はメイン領域に飛び出すため固定幅を維持 */
    min-width: 150px !important;
}

/* アイコンのポインター表示とホバー効果 */
.account-icon-img {
    cursor: pointer !important;
    transition: opacity 0.2s;
}

.account-icon-img:hover {
    opacity: 0.7;
}

/* 閉合時のサイドバー内メニューの表示領域確保（隠れ防止） */
.generator-top.sidebar-closed .sidemenu,
.sidebar-closed .sidemenu {
    overflow: visible !important;
}

/* ==========================================
   5. サブメニュー（階層メニュー）の超絶・確実な表示魔法
   ========================================== */

/* ▼▼▼ サイドバー自体を「最前面」に出して、右画面の裏に隠れるのを防ぐ！ ▼▼▼ */
.sidemenu {
    overflow: visible !important;
    z-index: 99999 !important; /* ★ここが超重要！メイン画面に負けない最強のz-index！ */
}

.simple-bottom-icon,
.account-popup-menu {
    overflow: visible !important;
}

.popup-item-wrapper {
    position: relative !important;
    width: 100% !important;
}

/* ==========================================
   5. サブメニュー（JS制御版・じぴたん風）
   ========================================== */

/* サブメニュー本体（JSでBody直下に移動します） */
.sub-popup-menu {
    display: none; /* 初期状態は非表示 */
    position: absolute;
    /* ▼ top や bottom はJSと喧嘩するので完全に消去！ ▼ */
    width: 240px; 
    background: #d6d6d6; 
    border: 1px solid #c8c8c8;
    border-radius: 20px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    padding: 8px 0;
    z-index: 999999; 
}

/* サブメニュー内のアイテムは少しゆとりを持たせる */
.sub-popup-menu .popup-item {
    padding: 5px 16px !important;
    white-space: nowrap !important; 
}

/* 密集させる項目（お知らせ・サービス・ヘルプ）の確実な余白調整 */
.popup-item.tight-item {
    padding: 3px 16px !important; 
}

/* ★JSで付与するクラス：サブメニュー展開時に親のホバー背景を維持 */
.popup-item-wrapper.is-active > .popup-item::before {
    background-color: rgba(0, 0, 0, 0.08) !important;
}

/* ==========================================
   サブメニュー項目のホバー時インタラクション設定
   ========================================== */

/* サブメニュー内の矢印は初期状態では【確実】に非表示！ */
.sub-popup-menu .popup-item .item-arrow {
    opacity: 0 !important;
    visibility: hidden !important;
    transition: opacity 0.2s ease, visibility 0s ease !important;
}

/* サブメニューの項目にホバーした時【だけ】矢印を表示！ */
.sub-popup-menu .popup-item:hover .item-arrow {
    opacity: 1 !important;
    visibility: visible !important;
}

/* 最上部のアカウント情報ヘッダーは例外として矢印なし＆ホバー効果無効 */
.popup-item.submenu-header {
    background-color: transparent !important;
    padding: 10px 16px !important;
    cursor: default !important;
}

.popup-item.submenu-header::before {
    display: none !important;
}

.popup-item.submenu-header .item-arrow {
    display: none !important;
}


/* ▼▼▼ 追加: プロフィール編集モーダル用のCSS ▼▼▼ */
.profile-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.4);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
}
.profile-modal-content {
    background-color: #ffffff;
    border-radius: 12px;
    padding: 40px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    text-align: center; /* アイコンを真ん中へ */
}
.profile-modal-title {
    font-size: 22px;
    font-weight: bold;
    color: #333;
    margin-bottom: 30px;
    margin-top: 0;
    text-align: left; /* タイトルは左寄せ */
}
.profile-icon-wrapper {
    margin-bottom: 30px;
    display: inline-block;
}
.profile-icon-img {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    border: 1px solid #ccc; /* 丸い枠線 */
    object-fit: cover;
}
/* マテリアル風の入力欄スタイル */
.profile-input-container {
    border: 1px solid #999;
    border-radius: 8px;
    padding: 8px 15px;
    margin-bottom: 35px;
    text-align: left;
}
.profile-input-label {
    display: block;
    font-size: 11px;
    color: #555;
    margin-bottom: 2px;
}
.profile-input-text {
    width: 100%;
    border: none;
    outline: none;
    font-size: 18px;
    color: #333;
    padding: 0;
    background: transparent;
    transition: border-color 0.2s;
    box-sizing: border-box; /* ★はみ出し防止 */
}
.profile-input-text:focus {
    border-color: #f28738;
}
.profile-modal-actions {
    display: flex;
    justify-content: center;
    gap: 15px;
}
.profile-btn-cancel {
    padding: 12px 30px;
    background-color: #ffffff;
    border: 1px solid #333;
    border-radius: 6px;
    color: #333;
    font-weight: bold;
    cursor: pointer;
    font-size: 16px;
    min-width: 140px;
}
.profile-btn-save {
    padding: 12px 30px;
    background-color: #f28738; /* オレンジ色 */
    border: none;
    border-radius: 6px;
    color: #ffffff;
    font-weight: bold;
    cursor: pointer;
    font-size: 16px;
    min-width: 140px;
}
/* ▲▲▲ 追加: プロフィール編集モーダル用のCSS ここまで ▲▲▲ */

/* ==========================================
   共通モーダルパーツ (設定 & メンバー追加用)
   ========================================== */
.custom-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.4);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 999999;
}

/* 必須・任意のバッジ */
.badge-required {
    background-color: #ff0000;
    color: #ffffff;
    font-size: 11px;
    padding: 2px 6px;
    border-radius: 4px;
    margin-left: 8px;
    font-weight: normal;
}
.badge-optional {
    background-color: #a0a0a0;
    color: #ffffff;
    font-size: 11px;
    padding: 2px 6px;
    border-radius: 4px;
    margin-left: 8px;
    font-weight: normal;
}

/* 閉じるボタン (×) */
.custom-modal-close {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 20px;
    cursor: pointer;
    color: #666;
    transition: color 0.2s;
    line-height: 1;
    z-index: 10;
}
.custom-modal-close:hover {
    color: #000;
}

/* ==========================================
   設定モーダル (Settings Modal)
   ========================================== */
.settings-modal-content {
    background-color: #ffffff;
    border-radius: 12px;
    width: 90%;
    max-width: 800px;
    height: 85vh; /* ★高さを 80vh -> 85vh に拡張 */
    max-height: 800px; /* ★上限を 600px -> 800px に拡張 */
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    display: flex;
    overflow: hidden;
    position: relative;
}

/* 左側：サイドバー */
.settings-sidebar {
    width: 220px;
    background-color: #ffffff;
    border-right: 1px solid #e0e0e0;
    padding: 50px 0 0 0; 
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
}

/* 左側用の×ボタン */
.settings-sidebar-close {
    position: absolute;
    top: 15px;
    left: 20px;
    font-size: 20px;
    cursor: pointer;
    color: #666;
    transition: color 0.2s;
    line-height: 1;
    z-index: 10;
}
.settings-sidebar-close:hover {
    color: #000;
}

/* 左側：メニューアイテム */
.settings-menu-item {
    padding: 12px 20px;
    cursor: pointer;
    color: #555;
    font-size: 15px;
    transition: background-color 0.2s, color 0.2s;
}
.settings-menu-item:hover {
    background-color: #f5f5f5;
}
.settings-menu-item.active {
    color: #333;
    font-weight: bold; /* アクティブ時を少し太字に */
}

/* 右側：コンテンツエリア */
.settings-body {
    flex-grow: 1;
    padding: 50px 40px 40px;
    overflow-y: auto;
    background-color: #ffffff;
}

/* タブの切り替え用 */
.settings-tab-content {
    display: none;
}
.settings-tab-content.active {
    display: block;
}

/* フォームの共通デザイン */
.settings-title {
    font-size: 24px;
    font-weight: normal;
    margin-bottom: 30px;
    color: #333;
}
.settings-form-group {
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
}
.settings-label {
    font-size: 18px;
    color: #333;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
}
.settings-input {
    width: 100%;
    border: 1px solid #999;
    border-radius: 8px;
    padding: 10px 15px;
    font-size: 16px;
    outline: none;
    background: transparent;
    transition: border-color 0.2s;
    box-sizing: border-box; /* ★はみ出し防止 */
}
.settings-input:focus {
    border-color: #f28738;
}
.settings-input:disabled {
    background-color: #f7f7f7;
    color: #888;
    border-color: #ccc;
    cursor: not-allowed;
}

/* ==========================================
   メンバー追加依頼モーダル (Member Request Modal)
   ========================================== */
.member-req-modal-content {
    background-color: #ffffff;
    border-radius: 12px;
    padding: 40px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    position: relative;
    box-sizing: border-box;
}
.member-req-title {
    font-size: 20px;
    font-weight: bold;
    color: #333;
    margin-bottom: 25px;
    margin-top: 0;
}
textarea.settings-input {
    resize: vertical;
    min-height: 100px;
}
.member-req-divider {
    border: none;
    border-top: 1px solid #eee;
    margin: 25px 0;
}
.member-req-actions {
    display: flex;
    justify-content: center;
}

/* ==========================================
   ★ レスポンシブ対応 (画面幅820px以下) ★
   ========================================== */
@media screen and (max-width: 820px) {
    /* 画面全体（黒背景ごと）をスクロールさせる */
    .custom-modal-overlay {
        align-items: flex-start; /* ベースは上揃えにしつつ... */
        padding: 40px 0;         /* 画面が小さい時用の上下余白 */
        overflow-y: auto;        
    }

    /* 設定モーダルを縦積みに変更 ＆ 高さを出し切る！ */
    .settings-modal-content {
        flex-direction: column;
        height: auto;             
        max-height: none;         
        width: 90%;
        max-width: 500px;
        /* ▼▼▼ ここがポイント！ 上下左右をautoにすると、余白がある時は自動で「ど真ん中」になります！ ▼▼▼ */
        margin: auto; 
    }

    /* メニューを上部のタブナビゲーション風に */
    .settings-sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid #e0e0e0;
        flex-direction: row;
        padding: 45px 10px 0px 10px; 
        overflow-x: auto;
        white-space: nowrap;
        flex-shrink: 0;
    }

    /* 左上にあった×ボタンを、スマホ時は右上に移動 */
    .settings-sidebar-close {
        left: auto;
        right: 15px;
    }

    /* スマホ時のメニューアイテム */
    .settings-menu-item {
        padding: 12px 15px;
        font-size: 14px;
        border-bottom: 2px solid transparent; 
    }
    .settings-menu-item.active {
        border-bottom: 2px solid #f28738; 
    }

    /* コンテンツエリアの余白をスマホ用に調整 */
    .settings-body {
        padding: 20px 25px 30px;
        overflow-y: visible;      
    }
    .settings-title {
        font-size: 20px;
        margin-bottom: 20px;
    }

    /* メンバー追加依頼モーダルのスマホ調整 */
    .member-req-modal-content {
        padding: 30px 20px;
        width: 90%;
        max-width: 500px;
        /* ▼▼▼ こちらもど真ん中に来るように auto に変更！ ▼▼▼ */
        margin: auto; 
    }
}

/* ==========================================
   アカウントアイコンの枠線（ランク別）
   ========================================== */
/* 左下の小さいアイコン用 */
.account-icon-img.border-manager { border: 2px solid #e67e22 !important; }
.account-icon-img.border-member  { border: 2px solid #8e44ad !important; }
.account-icon-img.border-single  { border: 2px solid #2ecc71 !important; }

/* モーダル内の大きいアイコン用（少し枠を太く） */
.profile-icon-img.border-manager { border: 3px solid #e67e22 !important; }
.profile-icon-img.border-member  { border: 3px solid #8e44ad !important; }
.profile-icon-img.border-single  { border: 3px solid #2ecc71 !important; }