.export-csv-btn,
/* スタイルを共通化 */
.export-ics-btn,
.google-calendar-btn {
    background-color: #e1e1e1;
    color: var(--secondary-color);
    /* Googleカレンダーボタンの色も一旦これで */
    padding: 8px 14px;
    font-size: 13px;
    margin-top: 5px;
    margin-left: 5px;
    /* ボタン間のスペース */
    border: 1px solid #ddd;
}

.google-calendar-btn {
    /* Googleカレンダーボタンの色を調整 */
    color: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.export-ics-btn {
    /* ICSエクスポートボタンの色を水色に */
    color: #31b5ff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

/* コメント入力欄スタイル */
.comment-input-container {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 5px auto;
    width: 100%;
    max-width: 800px;
}

.category-container {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ガントチャート関連のスタイル */
#gantt-chart-output {
    display: none;
    /* デフォルトで非表示 */
}

/* ガントチャートボタンのスタイル */
.gantt-btn {
    background-color: var(--secondary-color);
    /* 例: 緑色 */
    color: white;
    padding: 10px 16px;
    font-size: 14px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition:
        background-color 0.2s,
        transform 0.1s;
}

.gantt-btn:hover {
    opacity: 0.9;
}

.gantt-btn:active {
    transform: scale(0.97);
}

/* モーダルスタイル */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    display: none;
    /* 初期状態は非表示 */
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

/* スクロールテキストモーダル用のスタイル */
#scroll-text-items-list {
    max-height: 300px;
    overflow-y: auto;
    padding: 4px;
    margin: 8px 0;
}

/* スクロールテキストの選択肢ボタンスタイル */
#scroll-text-items-list .scroll-text-btn {
    width: 100%;
    text-align: left;
    padding: 8px;
    background-color: #f5f5f5;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    margin-bottom: 0;
    transition: background-color 0.2s;
}

#scroll-text-items-list .scroll-text-btn:hover {
    background-color: #e9e9e9;
}

#scroll-text-items-list div {
    margin-bottom: 4px !important;
}

#scroll-text-items-list div:last-child {
    margin-bottom: 0 !important;
}

/* スクロールバーのスタイリング */
#scroll-text-items-list::-webkit-scrollbar {
    width: 8px;
}

#scroll-text-items-list::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

#scroll-text-items-list::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

#scroll-text-items-list::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* 入力エリアを固定位置に */
#scroll-text-modal-overlay .modal-content {
    display: flex;
    flex-direction: column;
    padding: 16px;
    max-width: 400px;
    width: 95%;
    height: auto;
}

#scroll-text-modal-overlay .new-input-area {
    margin-top: auto;
    padding-top: 16px;
    border-top: 1px solid #eee;
    background: white;
}

.modal-content {
    background-color: white;
    padding: 20px;
    /* 少し減らす */
    border-radius: 8px;
    width: 95%;
    /* 幅を広げる */
    height: 90%;
    /* 高さを広げる */
    max-width: 1200px;
    /* 最大幅も設定 */
    display: flex;
    /* Flexbox を使用 */
    flex-direction: column;
    /* 縦方向に配置 */
    overflow: hidden;
    /* コンテンツ自体のスクロールは不要に */
    position: relative;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

#modal-gantt-chart {
    /* モーダル内のチャート専用スタイル */
    flex-grow: 1;
    /* 残りの高さをすべて使う */
    overflow: auto;
    /* チャートがはみ出たらスクロール */
    background-color: #fdfdfd;
    /* 背景色を少し変える */
    border: 1px solid #eee;
    /* 境界線 */
    border-radius: 4px;
    /* 角丸 */
    margin-top: 10px;
    /* ボタンとの間に少しスペース */
}

.modal-close-btn {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 24px;
    font-weight: bold;
    color: #555;
    cursor: pointer;
    border: none;
    background: none;
}

.modal-close-btn:hover {
    color: #000;
}

.modal-overlay.visible {
    display: flex;
    /* 表示時にflexに変更 */
}

/* --- Tabbed Notepad Styles --- */
.notepad-container {
    margin-bottom: 15px; /* Add some space below the notepad */
    /* border: 1px solid #ddd; */ /* Remove the main container border */
    border-radius: 4px;
    overflow: hidden; /* Ensure content doesn't overflow rounded corners */
    /* Add a subtle top/bottom border to the accordion button instead if needed */
}

.notepad-container .accordion-trigger {
    background-color: #f7f7f7;
    color: #333;
    cursor: pointer;
    padding: 10px 15px;
    width: 100%;
    border: none;
    border-bottom: 1px solid #ddd; /* Separator line */
    text-align: left;
    outline: none;
    font-size: 14px;
    font-weight: bold;
    transition: background-color 0.2s ease;
}

.notepad-container .accordion-trigger:hover {
    background-color: #eee;
}

.notepad-container .accordion-trigger.active {
    background-color: #e9e9e9;
}

#notepad-content {
    /* This is the accordion content area */
    padding: 0; /* Remove padding, handled by inner elements */
    background-color: white;
    /* display: none; /* Controlled by JS */
    overflow: hidden; /* For potential animations */
}

.notepad-controls {
    display: flex;
    align-items: center;
    background-color: #f0f0f0; /* Light background for controls */
    padding: 5px 10px;
    border-bottom: 1px solid #ccc;
}

.notepad-tabs-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-grow: 1; /* Allow tabs to take available space */
    overflow-x: auto; /* Allow horizontal scrolling if tabs overflow */
    gap: 4px; /* Space between tabs */
}

.notepad-tab-item {
    display: flex;
    align-items: center;
    padding: 6px 10px;
    background-color: #ddd;
    border: 1px solid #ccc;
    border-bottom: none; /* Remove bottom border */
    border-radius: 4px 4px 0 0; /* Rounded top corners */
    cursor: pointer;
    font-size: 13px;
    white-space: nowrap; /* Prevent tab name wrapping */
    transition: background-color 0.2s ease;
    position: relative; /* For absolute positioning of delete button */
}

.notepad-tab-item:hover {
    background-color: #e8e8e8;
}

.notepad-tab-item.active {
    background-color: white; /* Active tab matches content background */
    border-bottom: 1px solid white; /* Hide bottom border to merge with content */
    font-weight: bold;
    z-index: 1; /* Bring active tab slightly forward */
}

.notepad-tab-item .tab-name {
    margin-right: 15px; /* Space for delete button */
    display: inline-block; /* Needed for potential editing */
}

.notepad-tab-item .delete-tab-btn {
    background: none;
    border: none;
    color: #888;
    cursor: pointer;
    font-size: 14px;
    font-weight: bold;
    padding: 0 3px;
    position: absolute;
    right: 3px;
    top: 50%;
    transform: translateY(-50%);
    line-height: 1;
    opacity: 0.7;
    transition: opacity 0.2s ease;
}

.notepad-tab-item:hover .delete-tab-btn {
    opacity: 1;
    color: #555;
}
.notepad-tab-item .delete-tab-btn:hover {
    color: red;
}

.add-tab-btn {
    background-color: var(--secondary-color);
    color: white;
    border: none;
    border-radius: 50%; /* Make it circular */
    width: 24px;
    height: 24px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    margin-left: 10px; /* Space from tabs */
    text-align: center;
    transition: background-color 0.2s ease;
    display: flex; /* Ensure flex properties apply correctly */
    align-items: center; /* Vertically center the '+' */
    justify-content: center; /* Horizontally center the '+' */
}

.add-tab-btn:hover {
    background-color: var(--primary-color);
}

.notepad-contents-area {
    padding: 10px;
    border-top: 1px solid #ccc; /* Separator from tabs */
}

.notepad-content-panel {
    /* display: none; /* Controlled by JS */
}

.notepad-content-panel textarea {
    width: 100%;
    box-sizing: border-box; /* Include padding and border in width */
    border: 1px solid #ccc;
    border-radius: 4px;
    padding: 8px;
    font-family: inherit; /* Use the same font as the rest of the app */
    font-size: 14px;
    resize: vertical; /* Allow vertical resizing */
    min-height: 80px; /* Minimum height */
}

.tab-name-edit {
    padding: 2px 4px;
    font-size: 13px;
    border: 1px solid #999;
    border-radius: 3px;
    outline: none;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1);
    position: relative; /* Ensure it appears correctly */
    z-index: 2; /* Above other tab elements */
    width: 80px; /* Adjust as needed */
}
