/* ================= GANTT ================= */
.gantt-pane {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: var(--paper); /* solid, so the page's blueprint grid doesn't show through and clash with the gantt's own day grid */
  --gantt-label-width: 220px;
}
@media (max-width: 640px) {
  /* スマホ幅では日付グリッドの可視面積を確保するため、ラベル列を狭くする。
     JS側（gantt.js）はこの値をgetComputedStyleで読み、オフセット計算に使う。 */
  .gantt-pane { --gantt-label-width: 104px; }
}
.gantt-toolbar {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 20px;
  border-bottom: 1px solid var(--rule);
  flex-wrap: wrap;
}
.gantt-scroll {
  flex: 1;
  overflow: auto;
  position: relative;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}
.gantt-inner {
  position: relative;
}

.gantt-row-labels {
  position: sticky;
  left: 0;
  z-index: 3;
}

.gantt-header {
  position: sticky;
  top: 0;
  z-index: 4;
  display: flex;
  background: var(--paper);
  border-bottom: 1px solid var(--rule);
}
.gantt-header-label-spacer {
  position: sticky;
  left: 0;
  z-index: 5;
  width: var(--gantt-label-width);
  flex-shrink: 0;
  background: var(--paper);
  border-right: 1px solid var(--rule);
}
.gantt-header-days {
  display: flex;
}
.gantt-day-header {
  flex-shrink: 0;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--ink-faint);
  text-align: center;
  padding: 4px 0;
  border-right: 1px solid var(--grid-line);
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.gantt-day-header.today { color: var(--accent); font-weight: 700; }
.gantt-day-header.today .gantt-date-num { color: var(--accent); }
.gantt-day-header.month-start { border-left: 1px solid var(--rule); }
.gantt-day-header.weekend-sat .gantt-dow { color: #6FA8DC; }
.gantt-day-header.weekend-sun .gantt-dow { color: var(--red); }
.gantt-day-header .gantt-month-label {
  display: block;
  font-size: 9px;
  color: var(--ink-faint);
}
.gantt-day-header .gantt-dow {
  font-size: 9px;
  letter-spacing: 0.02em;
}
.gantt-day-header .gantt-date-num {
  font-size: 11px;
  color: var(--ink);
}

.gantt-body { position: relative; }
.gantt-row {
  display: flex;
  align-items: center;
  height: 34px;
  border-bottom: 1px solid var(--grid-line);
}
.gantt-row.has-milestones { height: 48px; }
.gantt-row-label {
  position: sticky;
  left: 0;
  z-index: 2;
  width: var(--gantt-label-width);
  flex-shrink: 0;
  background: var(--paper);
  border-right: 1px solid var(--rule);
  padding: 0 10px;
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: flex;
  align-items: center;
  gap: 6px;
}
.gantt-row-label-indent { flex-shrink: 0; }
@media (max-width: 640px) {
  .gantt-row-label { padding: 0 6px; font-size: 11px; gap: 4px; }
}
.gantt-row-track {
  position: relative;
  height: 100%;
  flex: 1;
}
.gantt-grid-col {
  position: absolute;
  top: 0;
  bottom: 0;
  border-right: 1px solid var(--grid-line);
}
.gantt-grid-col.today-line {
  border-right: 1.5px solid var(--accent);
  z-index: 1;
}
.gantt-grid-col.weekend { background: rgba(0,0,0,0.16); }

.gantt-bar {
  position: absolute;
  top: 6px;
  height: 22px;
  background: var(--paper-raised);
  border: 1.5px solid var(--accent);
  display: flex;
  align-items: center;
  padding: 0 8px;
  font-size: 11px;
  color: var(--ink);
  cursor: grab;
  user-select: none;
  touch-action: none;
}
.gantt-bar-label {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.gantt-bar.status-not_started { border-color: var(--ink-faint); }
.gantt-bar.status-in_progress { border-color: var(--amber); }
.gantt-bar.status-in_review { border-color: var(--accent); }
.gantt-bar.status-done { border-color: var(--green); background: rgba(111, 207, 151, 0.18); }
.gantt-bar.dragging { cursor: grabbing; z-index: 6; box-shadow: 0 2px 8px rgba(0,0,0,0.4); }
.gantt-bar-handle {
  position: absolute;
  top: -6px;
  bottom: -6px;
  width: 16px;
  cursor: ew-resize;
  touch-action: none;
}
.gantt-bar-handle.left { left: -6px; }
.gantt-bar-handle.right { right: -6px; }

.gantt-empty-track {
  height: 100%;
  cursor: crosshair;
  /* touch-action は意図的にautoのまま（＝スマホでは既定のスクロールを優先）。
     このトラックは行全体の全幅に及ぶため、touch-action: noneにするとスマホでの
     横スワイプ（日付グリッドの閲覧）が丸ごとブロックされてしまう。空欄からの
     ドラッグ新規作成は、gantt.jsのattachCreateDrag側でpointerType==='touch'を
     早期returnして無効化し、タッチではスクロールを優先する形にしている
     （マウス／ペンでは従来どおりドラッグ新規作成が使える）。*/
}
.gantt-draft-bar {
  position: absolute;
  top: 6px;
  height: 22px;
  background: rgba(127, 209, 232, 0.3);
  border: 1.5px dashed var(--accent);
  pointer-events: none;
}

.gantt-milestone-label {
  position: absolute;
  display: flex;
  align-items: center;
  gap: 3px; /* 10px文字に対する半角スペース1個分 */
  max-width: 124px;
  height: 13px;
  overflow: hidden;
  color: var(--review);
  font-size: 10px;
  line-height: 13px;
  white-space: nowrap;
  z-index: 5;
  pointer-events: auto;
  cursor: help;
}
.gantt-milestone-star {
  flex: 0 0 10px;
  width: 10px;
  text-align: center;
  font-size: 11px;
  font-weight: 700;
}
.gantt-milestone-star.review-overdue { color: var(--red); }
.gantt-milestone-content {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

