:root {
    --primary-color: #3a4664;
    --secondary-color: #5a6795;
    --accent-color: #c0a080;
    --light-color: #f5f5f7;
    --dark-color: #2c2c2e;
    --success-color: #4caf50;
    --warning-color: #ff9800;
    --danger-color: #f44336;
    --shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    --header-bg-color: #ffffff;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Playfair Display', 'Noto Serif JP', 'Palatino Linotype', 'Book Antiqua', Palatino, serif;
}

body {
    background-color: var(--light-color);
    color: var(--dark-color);
    line-height: 1.6;
}

.container {
    max-width: 100%;
    margin: 0 auto;
    padding: 0;
    position: relative;
}

.toolbar {
    background-color: var(--secondary-color);
    padding: 3px 15px;
    /* 5px 20pxから3px 15pxに削減 */
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    box-shadow: var(--shadow);
}

.toolbar-group {
    display: flex;
    gap: 10px;
    align-items: center;
}

.tabs {
    background-color: var(--light-color);
    display: flex;
    padding: 0 15px;
    /* 0 20pxから0 15pxに削減 */
    border-bottom: 1px solid #ddd;
}

.tab {
    padding: 3px 15px;
    /* 5px 20pxから3px 15pxに削減 */
    cursor: pointer;
    border-bottom: 2px solid transparent;
    /* 3pxから2pxに削減 */
    transition: all 0.3s;
    font-size: 0.9rem;
    /* フォントサイズを小さく */
}

.tab.active {
    border-bottom: 2px solid var(--accent-color);
    font-weight: bold;
}

button {
    background-color: var(--accent-color);
    color: white;
    border: none;
    padding: 5px 12px;
    /* 8px 16pxから5px 12pxに削減 */
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: var(--shadow);
    font-size: 0.85rem;
    /* フォントサイズを小さく */
}

button:hover {
    background-color: #a68e70;
}

/* セレクトボックスとインプット要素のサイズ調整 */
select,
input {
    padding: 5px;
    /* 8pxから5pxに削減 */
    border: 1px solid #ddd;
    border-radius: 4px;
    background-color: white;
    font-family: 'Noto Serif JP', serif;
    font-size: 0.9rem;
    /* フォントサイズを小さく */
}

.content {
    padding: 10px 10px 20px 20px;
    /* 上：10px、右：20px、下：20px、左：20px */
    background-color: white;
    min-height: calc(100vh - 120px);
    box-shadow: var(--shadow);
}

#gantt-container {
    overflow-x: auto;
    white-space: nowrap;
    position: relative;
    margin-top: 10px;
    width: 100%;
    height: calc(100vh - 180px); /* 250pxから180pxに削減 */
    max-height: none; /* 最大高さ制限を削除 */
    min-height: 600px; /* 最小高さを設定 */
}

#gantt-header {
    position: relative;
    height: 38px;
    /* ヘッダーの高さは固定のまま */
}

#gantt-grid {
    position: relative;
    height: auto;
    min-height: 38px;
}

.gantt-row {
    height: 19px;
    position: relative;
    border-bottom: 1px solid #ccc;
}

/* .gantt-category の高さを調整 */
.gantt-category {
    font-weight: bold;
    background-color: #f9f9f9;
    height: 120px;
    /* 160px * (2/3) = 約107px */
    padding-left: 10px;
    border-bottom: 1px solid #ccc;
    position: sticky;
    left: 0;
    z-index: 10;
    width: 150px;
    display: flex;
    align-items: center;
    justify-content: flex-start;
}

.gantt-row-content {
    margin-left: 150px;
    position: relative;
    /* background-color: inherit !important; 親要素の背景色を継承 */
}

/* 月表示の位置調整 */
.month-grid {
    border: 1px solid #aaa;
    position: absolute;
    height: 100%;
    z-index: 1;
    text-align: center;
    background-color: var(--header-bg-color);
    top: 0;
    /* 位置を上部に確実に固定 */
    line-height: 20px;
    /* テキスト配置の微調整 */
}

.day-grid {
    border: 1px solid #ddd;
    position: absolute;
    height: 100%;
    z-index: 1;
    color: #333;
    text-align: center;
    font-size: 12px;
    padding-top: 0px;
    /* min-width: 20px; */
    overflow: visible;
    white-space: nowrap;
    background-color: var(--header-bg-color);
}

.day-grid.special-date {
    background-color: transparent;
    /* グレー背景を削除 */
}

.day-grid.week-start {
    border-left: 2px solid #666;
}

/* ガントチャートコンテナの上部余白調整 */
#gantt-container {
    margin-top: 2px;
    /* 調整が必要な場合 */
}

.today-line {
    position: absolute;
    top: 0;
    height: 100%;
    width: 2px;
    background-color: var(--danger-color);
    z-index: 2;
}

.gantt-item {
    position: absolute;
    height: 40px;
    top: 10px;
    border-radius: 4px;
    padding: 3px 3px;
    color: white;
    cursor: pointer;
    z-index: 3;
    box-shadow: var(--shadow);
    box-sizing: border-box;
    line-height: 1.2;
    /* Reduce from default */
}

/* コンテンツ内の余白も調整 */
.gantt-item>div {
    padding: 0 1px;
    /* 内部コンテンツの左右パディングも縮小 */
}

/* テキスト要素の左右マージンも縮小 */
.task-title,
.milestone-label,
.milestone-memo {
    margin-left: 1px;
    margin-right: 1px;
}

.days-count {
    position: absolute;
    bottom: 2px;
    right: 5px;
    font-size: 10px;
    opacity: 0.8;
}

.item-assignee {
    font-size: 0.8em;
    opacity: 0.9;
}

.gantt-milestone {
    position: absolute;
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-bottom: 16px solid var(--dark-color);
    top: 70px;
    z-index: 3;
    cursor: pointer;
}

/* In styles.css, update milestone-label and milestone-memo styles */
.milestone-label {
    position: absolute;
    font-size: 11px;
    font-weight: bold;
    white-space: nowrap;
    pointer-events: none;
    z-index: 3;
    text-align: center !important;
    width: 100px;
    transform: translateX(-50%) !important;
    top: 88px;
    /* Ensure proper centering */
}

.milestone-memo {
    position: absolute;
    font-size: 9px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 120px;
    z-index: 3;
    text-align: center !important;
    transform: translateX(-50%) !important;
    /* top: 88px; */
    /* Ensure proper centering */
}

.gantt-dependency {
    position: absolute;
    z-index: 2;
    pointer-events: none;
}

#item-list {
    width: 100%;
    border-collapse: collapse;
}

#item-list th,
#item-list td {
    border: 1px solid #ddd;
    padding: 10px;
    text-align: left;
}

#item-list th {
    background-color: var(--secondary-color);
    color: white;
}

#item-list tr:nth-child(even) {
    background-color: #f9f9f9;
}

.filter-controls {
    margin-bottom: 15px;
    padding: 10px;
    background-color: #f5f5f7;
    border-radius: 4px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.filter-controls label {
    display: flex;
    align-items: center;
    gap: 5px;
}

.filter-controls select,
.filter-controls input {
    padding: 5px;
    border: 1px solid #ddd;
    border-radius: 3px;
}

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.modal-content {
    background-color: white;
    padding: 20px;
    border-radius: 8px;
    max-width: 700px;
    width: 100%;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    z-index: 1001;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.modal-header h2 {
    color: var(--primary-color);
}

.close-modal {
    font-size: 24px;
    cursor: pointer;
    color: #777;
}

/* フォーム要素のマージンを小さく */
.form-group {
    margin-bottom: 10px;
    /* 15pxから10pxに削減 */
}

/* チケット編集モーダル向けの特別なスタイル */
#ticket-modal .form-group {
    margin-bottom: 8px;
    /* チケットモーダルでは更に小さく */
}

#ticket-modal .form-columns {
    gap: 10px;
    /* 15pxから10pxに削減 */
    margin-bottom: 10px;
    /* 15pxから10pxに削減 */
}

#ticket-modal textarea {
    padding: 5px;
    min-height: 60px;
    /* テキストエリアの高さを調整 */
}

#ticket-modal .modal-content {
    max-height: 90vh;
    /* 画面の90%までの高さに制限 */
    overflow-y: auto;
    /* スクロール可能に */
}

#ticket-modal .form-actions {
    margin-top: 10px;
    /* 20pxから10pxに削減 */
    padding-top: 5px;
    border-top: 1px solid #eee;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    color: var(--primary-color);
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 20px;
}

.hidden {
    display: none;
}

.edit-btn {
    padding: 5px 12px;
    font-size: 12px;
}

.text-danger {
    color: white;
    background-color: #777777;
}

.usage-guide-button {
    position: fixed;
    bottom: 20px;
    left: 20px;
    background-color: var(--accent-color);
    color: white;
    padding: 5px 12px;
    border-radius: 4px;
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    z-index: 900;
    transition: all 0.3s;
}

.usage-guide-button:hover {
    background-color: #a68e70;
}

#app-info {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    max-width: 600px;
    background-color: rgba(255, 255, 255, 0.95);
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    z-index: 900;
}

#close-info {
    position: absolute;
    top: 5px;
    right: 5px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
}

#sync-status {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background-color: white;
    padding: 8px 15px;
    border-radius: 4px;
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    gap: 10px;
    z-index: 1000;
}

.sync-indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: inline-block;
}

.sync-indicator.synced {
    background-color: var(--success-color);
}

.sync-indicator.syncing {
    background-color: var(--warning-color);
    animation: pulse 1.5s infinite;
}

.sync-indicator.conflict {
    background-color: var(--danger-color);
}

.form-columns {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 15px;
}

.form-column {
    flex: 1;
    min-width: 250px;
}

.full-width {
    width: 100%;
}

@keyframes pulse {
    0% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }

    100% {
        opacity: 1;
    }
}

.time-grid {
    position: absolute;
    width: 100%;
    height: 1px;
    background-color: #ddd;
    z-index: 1;
}

.time-label {
    position: absolute;
    font-size: 11px;
    color: #666;
    pointer-events: none;
    z-index: 2;
    margin-left: 5px;
}

.gantt-item:hover {
    cursor: move;
}

.gantt-item:hover::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 5px;
    background-color: rgba(0, 0, 0, 0.1);
    cursor: n-resize;
}

.gantt-item:hover::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 5px;
    background-color: rgba(0, 0, 0, 0.1);
    cursor: s-resize;
}

/* プロジェクト選択モーダル用スタイル */
.project-list-container {
    max-height: 300px;
    overflow-y: auto;
    margin-bottom: 20px;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 10px;
}

.project-item {
    padding: 10px;
    margin-bottom: 5px;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.project-item:hover {
    background-color: #f5f5f5;
}

.project-item.selected {
    background-color: #e6f7ff;
    border: 1px solid #91d5ff;
}

.loading-message {
    text-align: center;
    padding: 20px;
    color: #666;
}

.input-group {
    display: flex;
    gap: 5px;
}

.input-group input {
    flex: 1;
}

/* カテゴリー折りたたみスタイル */
.category-toggle-btn {
    background-color: transparent;
    border: none;
    color: #333;
    cursor: pointer;
    padding: 2px 5px;
    box-shadow: none;
    transition: transform 0.2s;
}

.category-toggle-btn:hover {
    background-color: rgba(0, 0, 0, 0.1);
}

/* 収納された大項目行の高さを半分に削減 */
.gantt-row.collapsed {
    height: 10px !important;
    /* 40pxから20pxに削減 */
}

/* 収納された大項目のカテゴリーラベル調整 */
.gantt-row.collapsed .gantt-category {
    height: 10px !important;
    line-height: 10px !important;
    width: 75px !important;
    /* 幅を半分に削減 */
    font-size: 10px !important;
    /* 文字サイズを小さく */
    padding-left: 5px;
    /* 左パディングも調整 */
}

/* 収納時のトグルボタンサイズ調整 */
.gantt-row.collapsed .category-toggle-btn {
    font-size: 8px;
    padding: 1px 3px;
    margin-right: 4px;
}

/* カテゴリー並び替えボタン */
.move-btn {
    padding: 2px 5px;
    margin-right: 5px;
    background-color: transparent;
    border: 1px solid #ddd;
    color: #555;
    cursor: pointer;
    font-size: 10px;
    transition: background-color 0.2s;
}

.move-btn:hover {
    background-color: #f0f0f0;
}

/* チケット関連のスタイル */
.ticket-line {
    position: absolute;
    width: 1px;
    height: 100%;
    background-color: #ff0000;
    z-index: 4;
    cursor: pointer;
    transform: translateX(0.5px)
}

.ticket-label {
    position: absolute;
    background-color: rgba(255, 255, 255, 0.8);
    border: 1px solid #ff0000;
    padding: 2px 5px;
    border-radius: 3px;
    font-size: 12px;
    z-index: 100;
    cursor: pointer;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: center;
}

.ticket-details {
    position: absolute;
    background-color: white;
    border: 1px solid #ff0000;
    padding: 8px;
    border-radius: 4px;
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.3);
    z-index: 6;
    display: none;
    width: 250px;
}

.ticket-vertical-line {
    position: absolute;
    width: 1px;
    height: 100%;
    background-color: #ff0000;
    z-index: 4;
}

.ticket-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
}

.ticket-table th,
.ticket-table td {
    border: 1px solid #ddd;
    padding: 8px;
    text-align: left;
}

.ticket-table th {
    background-color: #f2f2f2;
    font-weight: bold;
}

.ticket-table tr:nth-child(even) {
    background-color: #f9f9f9;
}

.ticket-table tr:hover {
    background-color: #f1f1f1;
}

.status-unresolved {
    color: white;
    background-color: #f44336;
    padding: 2px 5px;
    border-radius: 3px;
}

.status-resolved {
    color: white;
    background-color: #4caf50;
    padding: 2px 5px;
    border-radius: 3px;
}

.status-memo {
    color: white;
    background-color: #333;
    padding: 2px 5px;
    border-radius: 3px;
}

.tickets-actions {
    margin: 10px 0;
}

.checkbox-list {
    max-height: 120px;
    overflow-y: auto;
    border: 1px solid #ddd;
    padding: 8px;
    border-radius: 4px;
    background-color: #f9f9f9;
}

.category-checkbox,
.item-checkbox {
    margin-bottom: 5px;
}

.category-checkbox label,
.item-checkbox label {
    margin-left: 5px;
}

.edit-ticket-btn,
.delete-btn {
    padding: 3px 8px;
    font-size: 12px;
    background-color: #5a6795;
    color: white;
    border: none;
    border-radius: 3px;
    cursor: pointer;
}

.delete-btn {
    background-color: #f44336;
}

.edit-ticket-btn:hover,
.delete-btn:hover {
    opacity: 0.8;
}

.ticket-line {
    cursor: pointer;
}

.ticket-label {
    cursor: pointer;
    transition: background-color 0.2s;
}

.ticket-label:hover {
    background-color: rgba(255, 255, 255, 0.95) !important;
}

.item-checkbox {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

#ticket-items-list {
    max-height: 200px;
    overflow-y: auto;
}

.ticket-tooltip {
    position: absolute;
    background-color: white;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 8px;
    max-width: 280px;
    z-index: 1000;
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.16);
    pointer-events: auto;
    /* 重要: リンクをクリック可能にする */
    font-size: 12px;
    line-height: 1.3;
}

.ticket-tooltip a {
    color: #0066cc;
    text-decoration: underline;
    cursor: pointer;
}

.ticket-tooltip a:hover {
    color: #004080;
}

.ticket-tooltip strong {
    font-size: 13px;
    color: #333;
}

.ticket-label:hover {
    z-index: 15;
    background-color: rgba(255, 0, 0, 0.5) !important;
}

/* ボタンのアクティブ状態用スタイル */
.toolbar button.active {
    background-color: #c0a080;
}

.toolbar button:not(.active) {
    background-color: #a68e70;
}

/* 解決済みチケットの行に横線を追加 */
.resolved-ticket {
    text-decoration: line-through;
    color: #888;
}

/* 解決済みチケットの行内の操作ボタンは線を消さない */
.resolved-ticket button {
    text-decoration: none;
    color: white;
}

/* デバッグコントロール用のスタイル */
.debug-controls {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
    align-items: center;
}

.debug-control-button {
    padding: 5px 10px;
    background-color: #5a6795;
    color: white;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    font-size: 12px;
}

.debug-control-button:hover {
    background-color: #3a4664;
}

.debug-control-button.paused {
    background-color: #f44336;
}

.debug-status {
    font-size: 12px;
    color: #666;
    margin-left: auto;
}

/* デバッグログのテキスト選択を可能に */
.debug-log {
    user-select: text;
    cursor: text;
}

/* 選択されたアイテムのスタイル */
.gantt-item.selected {
    border: 2px dashed #ffffff !important;
    box-shadow: 0 0 8px rgba(255, 255, 255, 0.7) !important;
    z-index: 5 !important;
    /* 選択アイテムを前面に */
}

/* 選択されたマイルストーンのスタイル調整 */
.gantt-milestone.selected {
    border: none !important;
    outline: 2px dashed #000000 !important;
    /* 黒い点線に変更 */
    outline-offset: 2px !important;
    box-shadow: 0 0 14px rgba(0, 0, 0, 0.5) !important;
    /* 影も黒に変更 */
    z-index: 5 !important;
}

/* 複数選択ボタンのアクティブ状態 */
#multi-select-btn.active {
    background-color: #c0a080 !important;
}

.gantt-row.collapsed .gantt-row-content {
    display: block !important;
    height: 10px;
    overflow: visible;
}

/* 折りたたまれた行の日付グリッド線 */
.gantt-row.collapsed .day-grid {
    height: 10px !important;
    opacity: 0.5;
    /* 半透明に */
}

/* 折りたたまれた行のチケットライン */
.gantt-row.collapsed .ticket-line {
    height: 10px !important;
}

/* 折りたたまれた行のチケットラベル */
.gantt-row.collapsed .ticket-label {
    font-size: 9px;
    padding: 1px 3px;
    bottom: 1px !important;
}

/* 折りたたまれた行のコンテンツのスタイル */
.collapsed-content {
    opacity: 0.8;
    /* 全体的に少し透明に */
}

/* リンク入力フィールド用のスタイル */
input[type="url"] {
    cursor: pointer;
    color: #0066cc;
    text-decoration: underline;
}

input[type="url"]:hover {
    color: #004080;
}

.full-width {
    width: 100%;
}

/* ボタンのアクティブ状態用スタイル */
.toggle-button {
    position: relative;
    padding: 5px 12px;
    border-radius: 4px;
    cursor: pointer;
    background-color: #a68e70;
    color: white;
    transition: all 0.3s;
    box-shadow: var(--shadow);
    border: none;
}

/* アクティブ状態 */
.toggle-button.active {
    background-color: #3498db;
}

/* 複数選択ボタンのアクティブ状態 */
#multi-select-btn.active {
    background-color: #3498db;
    font-weight: bold;
}

/* チケット表示ボタンのアクティブ状態 */
#toggle-tickets.active {
    background-color: #3498db;
}

/* 元に戻すボタンのスタイル */
.undo-btn {
    background-color: #5a6795;
    display: flex;
    align-items: center;
    gap: 5px;
}

.undo-btn:before {
    content: "↩";
    font-size: 1.2em;
}

.undo-btn:disabled {
    background-color: #aaa;
    cursor: not-allowed;
}

/* アンドゥ通知のスタイル */
.undo-notification {
    position: fixed;
    bottom: 100px;
    right: 20px;
    background-color: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 10px 20px;
    border-radius: 5px;
    z-index: 1000;
    transition: opacity 0.5s;
}

/* 折りたたまれた行内のガントアイテム（タスク）を調整 */
.gantt-row.collapsed .gantt-item {
    height: 8px !important;
    /* 高さを大幅に削減 */
    top: 1px !important;
    /* 上端に配置 */
    opacity: 0.8;
    /* 若干透明に */
}

/* 折りたたまれた行内のタスクタイトルを小さく */
.gantt-row.collapsed .gantt-item div,
.gantt-row.collapsed .gantt-item span {
    font-size: 0px !important;
    /* 文字サイズを非常に小さく 6*/
    line-height: 1.0 !important;
    /* 行間を詰める */
    white-space: nowrap;
    /* 折り返しなし */
    overflow: hidden;
    /* はみ出し部分を隠す */
    text-overflow: ellipsis;
    /* はみ出し時は省略記号を表示 */
}

/* 折りたたまれた行内のマイルストーンも調整 */
.gantt-row.collapsed .gantt-milestone {
    transform: scale(0.5) !important;
    /* サイズを半分に */
    top: -5px !important;
    /* 上端に配置 */
    opacity: 0.8;
    /* 若干透明に */
}

/* 折りたたまれた行内のマイルストーンラベルとメモを非表示 */
.gantt-row.collapsed .milestone-label,
.gantt-row.collapsed .milestone-memo {
    display: none !important;
    /* 非表示に */
}

/* 折りたたまれた行内の日数表示を隠す */
.gantt-row.collapsed .days-count {
    display: none !important;
}

/* 折りたたまれた行の中のグリッド線も表示 */
.gantt-row.collapsed .gantt-row-content {
    display: block !important;
    height: 10px;
    overflow: visible;
}

/* 折りたたまれた行の日付グリッド線 */
.gantt-row.collapsed .day-grid {
    height: 10px !important;
    opacity: 0.5;
    /* 半透明に */
}

/* 入出力矢印のスタイル */
.input-connection {
    stroke: #4285F4;
    /* インプットは青 */
    stroke-width: 2;
    fill: none;
    stroke-dasharray: 4;
}

.output-connection {
    stroke: #EA4335;
    /* アウトプットは赤 */
    stroke-width: 2;
    fill: none;
    stroke-dasharray: 4;
}

/* フォーム内の見出し */
.form-group h4 {
    margin-top: 10px;
    margin-bottom: 5px;
    color: var(--primary-color);
    font-weight: 500;
    border-bottom: 1px solid #eee;
    padding-bottom: 5px;
}

/* オプショングループのスタイル */
optgroup {
    font-weight: bold;
    font-style: normal;
    color: #333;
    background-color: #f5f5f5;
}

optgroup[label="必須"] {
    color: #d32f2f;
}

optgroup[label="任意"] {
    color: #2196f3;
}

optgroup option {
    font-weight: normal;
    padding-left: 10px;
    color: #333;
}

/* 折りたたまれた行における矢印のスタイル */
.gantt-row.collapsed .input-connection,
.gantt-row.collapsed .output-connection {
    stroke-width: 1;
    opacity: 0.8;
}

/* 必須項目のマーク */
.required {
    color: #e74c3c;
}

/* フォームセクションヘッダー */
.form-section-header {
    margin-top: 0;
    margin-bottom: 10px;
    color: var(--primary-color);
    font-weight: 500;
    border-bottom: 1px solid #eee;
    padding-bottom: 5px;
}

/* 矢印表示ボタンのアクティブ状態 */
#toggle-arrows.active {
    background-color: #3498db;
}

/* アクティブでない状態も統一 */
#toggle-arrows:not(.active),
#toggle-tickets:not(.active) {
    background-color: #a68e70;
}

/* styles.cssに追加 */
/* 小さい画面でのモーダル表示改善 */
.modal-content {
    max-height: 85vh;
    overflow-y: auto;
    padding: 15px;
    /* 小さい画面向けにパディングを縮小 */
}

/* フォームグループの余白を縮小 */
.form-group {
    margin-bottom: 8px;
    /* 15pxから8pxに縮小 */
}

/* 見出しのサイズと余白を縮小 */
.form-section-header {
    margin-top: 8px;
    margin-bottom: 5px;
    font-size: 0.95em;
    padding-bottom: 3px;
}

/* 入力フィールド間の間隔を縮小 */
.form-columns {
    gap: 10px;
    /* 15pxから10pxに縮小 */
}

/* styles.css に追加 */
.dependency-warning {
    position: absolute;
    font-size: 16px;
    color: red;
    z-index: 15;
    animation: pulse 1s infinite;
    cursor: help;
}

/* 折りたたまれた行内のマイルストーンラベルとメモを非表示 */
.gantt-row.collapsed .milestone-label,
.gantt-row.collapsed .milestone-memo {
    display: none !important;
}


/* ドラッグ中のカーソルスタイル改善 */
.gantt-item:active,
.gantt-milestone:active {
    cursor: grabbing !important;
}

/* ガントチャート全体のドラッグ中スタイル */
#gantt-container.dragging {
    cursor: grabbing !important;
}

/* ドラッグ可能要素とガントチャート全体のテキスト選択を無効化 */
.gantt-item,
.gantt-milestone,
.gantt-category,
.gantt-row,
.gantt-row-content,
.day-grid,
.month-grid,
.gantt-grid,
#gantt-header,
#gantt-container {
    user-select: none !important;
    -webkit-user-select: none !important;
    -moz-user-select: none !important;
    -ms-user-select: none !important;
}

/* 自動配置完了通知のスタイル */
.auto-arrange-notification {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: rgba(52, 152, 219, 0.9);
    color: white;
    padding: 15px 30px;
    border-radius: 8px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
    font-size: 18px;
    font-weight: bold;
    z-index: 2000;
    animation: fadeInOut 2.5s forwards;
    text-align: center;
}

@keyframes fadeInOut {
    0% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.8);
    }

    15% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1.1);
    }

    30% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }

    80% {
        opacity: 1;
    }

    100% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.9);
    }
}

/* 同期インジケーターのタイムアウト状態 */
.sync-indicator.timeout {
    background-color: #f44336;
    /* 赤色 */
    animation: pulse 1.5s infinite;
}

/* 同期状態テキストのタイムアウト状態 */
#sync-status-text:has(+ .sync-indicator.timeout) {
    color: #f44336;
    /* 赤色 */
    font-weight: bold;
}

/* ステータスに応じたスタイルを追加 */
.gantt-item[data-status="incomplete"] {
    border: 5px solid #ffc107 !important;
    box-shadow: 0 0 7px rgba(255, 193, 7, 0.6) !important;
}

.gantt-item[data-status="complete"] {
    border: 5px solid #4caf50 !important;
    box-shadow: 0 0 7px rgba(76, 175, 80, 0.6) !important;
}

/* 一括時間設定にもステータス設定を追加 */
#item-modal .task-status-group {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 5px;
}

#item-modal .task-status-group select {
    flex: 1;
}

/* タスクの右側を尖らせて方向性を示す */
.gantt-item-direction {
    clip-path: polygon(0 0, calc(100% - 6px) 0, 100% 50%, calc(100% - 6px) 100%, 0 100%);
}

/* clip-pathをサポートしていない古いブラウザ向けの代替スタイル */
@supports not (clip-path: polygon(0 0, 0 0, 0 0)) {
    .gantt-item-direction::after {
        content: '';
        position: absolute;
        right: -5px;
        top: 50%;
        transform: translateY(-50%);
        width: 0;
        height: 0;
        border-top: 5px solid transparent;
        border-bottom: 5px solid transparent;
        border-left: 5px solid currentColor;
        opacity: 0.7;
    }
}

/* アニメーションの定義 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}


/* モーダルのアニメーション */
.modal-content {
    animation: fadeIn 0.25s ease-out;
}

/* 本日の日付テキストを白くして見やすくする */
.today-header + .day-grid {
    color: white !important;
    font-weight: bold !important;
}

/* 本日の日付スタイル */
.today-date {
    color: white !important;
    background-color: rgba(244, 67, 54, 0.9) !important;
    font-weight: bold !important;
    border-radius: 3px;
    padding: 0 2px;
}

/* 本日の背景表示の改善 */
.today-background {
    background-color: rgba(244, 67, 54, 0.35) !important;
    border-left: 2px solid #f44336;
    border-right: 2px solid #f44336;
}

/* 本日のヘッダー背景の改善 */
.today-header {
    background-color: rgba(244, 67, 54, 0.4) !important;
    border-left: 2px solid #f44336;
    border-right: 2px solid #f44336;
}

/* 縦リサイズ時のカーソル */
.gantt-item:hover::before {
    cursor: ns-resize;
}

.gantt-item:hover::after {
    cursor: ns-resize;
}

/* ---------------------------------- */
/* ---------------------------------- */
/* 検索ハイライトの改善 - より大胆に */
.search-highlight {
    outline: 5px solid #ff6b35 !important;  /* 3px → 5pxに太く、色も鮮やかに */
    outline-offset: 3px;  /* 2px → 3pxに広げる */
    box-shadow: 0 0 20px rgba(255, 107, 53, 0.8), 
                0 0 40px rgba(255, 107, 53, 0.5) !important;  /* 光る効果を追加 */
    /* animation: searchPulse 0.1s infinite; を削除 */
    z-index: 100 !important;
}

/* アクティブな検索結果の強調 - さらに目立つように */
.search-highlight-active {
    outline: 6px solid #ff3d00 !important;  /* 4px → 6pxに */
    outline-offset: 4px;  /* 3px → 4pxに */
    box-shadow: 0 0 30px rgba(255, 61, 0, 1), 
                0 0 60px rgba(255, 61, 0, 0.7),
                inset 0 0 20px rgba(255, 255, 255, 0.3) !important;  /* 内側の光も追加 */
    animation: searchPulseActive 0.1s ease-out; /* 0.1s → 0.3sに変更してより見やすく */
    /* transform: scale(2.0) !important; は残す */
}

/* 検索パルスアニメーションをより派手に - 削除またはコメントアウト */
/* このアニメーションは使わないのでコメントアウト
@keyframes searchPulse {
    0% { 
        outline-color: #ff6b35;
        box-shadow: 0 0 20px rgba(255, 107, 53, 0.8), 
                    0 0 40px rgba(255, 107, 53, 0.5);
    }
    50% { 
        outline-color: #ffd600;
        box-shadow: 0 0 30px rgba(255, 214, 0, 1), 
                    0 0 60px rgba(255, 214, 0, 0.7);
    }
    100% { 
        outline-color: #ff6b35;
        box-shadow: 0 0 20px rgba(255, 107, 53, 0.8), 
                    0 0 40px rgba(255, 107, 53, 0.5);
    }
}
*/

/* アクティブアニメーションも修正 - 一回だけ実行される */
@keyframes searchPulseActive {
    0% { 
        transform: scale(1);
        box-shadow: 0 0 30px rgba(255, 61, 0, 1);
    }
    50% { 
        transform: scale(1.3);  /* 最大2倍に拡大 */
        box-shadow: 0 0 50px rgba(255, 61, 0, 1), 
                    0 0 100px rgba(255, 61, 0, 0.8);
    }
    100% { 
        transform: scale(1);  /* 元のサイズに戻る */
        box-shadow: 0 0 30px rgba(255, 61, 0, 1), 
                    0 0 60px rgba(255, 61, 0, 0.7);
    }
}

/* 検索結果情報の表示も少し目立つように */
#search-info {
    display: inline-block;
    padding: 5px 10px;
    background-color: #ff6b35;  /* オレンジ背景 */
    color: white;  /* 白文字 */
    border-radius: 15px;  /* 丸みを帯びた形 */
    font-weight: bold;
    font-size: 13px;  /* 少し大きく */
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

/* 依存関係警告ツールチップのスタイル */
.dependency-warning-tooltip {
    position: fixed;
    background-color: white;
    border: 2px solid #ff0000;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    z-index: 2000;
    padding: 15px;
    max-width: 350px;
    pointer-events: auto;
}

.warning-tooltip-content {
    font-size: 13px;
    line-height: 1.5;
}

.warning-message {
    color: #d32f2f;
    font-weight: bold;
    margin-bottom: 8px;
}

.suggestion-message {
    color: #333;
    margin-bottom: 12px;
}

.fix-dependency-btn {
    background-color: #4caf50;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: bold;
    width: 100%;
    transition: background-color 0.3s;
}

.fix-dependency-btn:hover {
    background-color: #45a049;
}

/* 警告アイコンのホバー効果を強化 */
.dependency-warning {
    transition: transform 0.2s;
}

.dependency-warning:hover {
    transform: scale(1.2);
}