.timeline-page {
  padding: 48px;
}
.timeline-head { margin-bottom: 32px; }

.timeline-mobile { display: none; }

.timeline-container {
  display: grid;
  grid-template-columns: 320px minmax(400px, 1fr) 220px;
  gap: 0;
  border: 1px solid var(--line);
  background: #fff;
  min-height: 400px;
  overflow: hidden;
}

/* ---- task pane (left) ---- */
.task-pane { border-right: 1px solid var(--line); display: flex; flex-direction: column; }
.task-header {
  display: grid; grid-template-columns: 1fr 90px;
  padding: 12px 16px;
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.1em;
  color: var(--ink-mute);
  background: #fafaf7;
  border-bottom: 1px solid var(--line);
}
.task-list { flex: 1; }
.task-row {
  display: grid; grid-template-columns: 1fr 90px;
  padding: 8px 16px;
  border-bottom: 1px solid #f2f2ec;
  font-size: 14px;
  align-items: center;
  height: 36px;
}
.task-row.is-group { font-weight: 600; background: #fafaf7; }
.task-row.is-subtask .task-name { padding-left: 16px; color: var(--ink-soft); font-size: 13px; }
.task-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.task-status {
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.05em;
  padding: 2px 8px; border-radius: 10px; text-align: center;
  justify-self: end;
  background: #eee; color: var(--ink-mute);
}
.task-status.s-done       { background: #d6e9d8; color: #2d6b3f; }
.task-status.s-active     { background: #fde8c4; color: #8a5a1f; }
.task-status.s-pending    { background: #ececec; color: #777; }
.task-status.s-blocked    { background: #fad6d6; color: #8c2c2c; }

/* ---- gantt pane (middle) ---- */
.gantt-pane { display: flex; flex-direction: column; position: relative; overflow: hidden; }
.gantt-header {
  display: flex;
  height: 41px;
  background: #fafaf7;
  border-bottom: 1px solid var(--line);
  position: relative;
}
.month-cell {
  flex: 1;
  text-align: center;
  font-size: 11px;
  color: var(--ink-mute);
  padding-top: 12px;
  border-right: 1px solid #f2f2ec;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}
.month-cell:last-child { border-right: none; }

.gantt-body { position: relative; flex: 1; }
.gantt-rows { position: relative; }
.gantt-row {
  height: 36px;
  border-bottom: 1px solid #f2f2ec;
  position: relative;
}
.gantt-row.is-group { background: #fafaf7; }

.bar {
  position: absolute;
  top: 8px; height: 20px;
  border-radius: 3px;
  font-size: 11px;
  color: #fff;
  padding: 3px 8px;
  white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis;
  display: flex; align-items: center;
  box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}
.bar.cat-logistics { background: #5c8ec2; }
.bar.cat-training  { background: #6db58a; }
.bar.cat-content   { background: #c98a5b; }
.bar.cat-travel    { background: #9579b8; }
.bar.cat-prep      { background: #4ba89e; }
.bar.s-pending     { opacity: 0.6; }
.bar.s-done        { opacity: 0.85; }
.bar.s-blocked     { background: #d68a8a !important; }

/* ---- marker overlay ---- */
.marker-layer {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  pointer-events: none;
}
.marker {
  position: absolute;
  top: 0; bottom: 0;
  width: 0;
}
.marker-line {
  position: absolute;
  top: 0; bottom: 0;
  width: 2px;
  margin-left: -1px;
}
.marker.m-deadline   .marker-line { background: var(--warn); }
.marker.m-milestone  .marker-line { background: #2c5f5d; width: 3px; margin-left: -1.5px; }
.marker.m-holiday    .marker-line { background: repeating-linear-gradient(0deg, #c4477a 0, #c4477a 4px, transparent 4px, transparent 8px); opacity: 0.5; width: 2px; }
.marker.m-event      .marker-line { background: #c98a5b; }
.marker-cap {
  position: absolute;
  top: 4px; left: 0;
  transform: translateX(-50%);
  background: var(--warn);
  color: #fff;
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 2px;
  white-space: nowrap;
  letter-spacing: 0.04em;
}
.marker.m-milestone .marker-cap { background: #2c5f5d; font-weight: 600; }
.marker.m-holiday .marker-cap { background: #c4477a; opacity: 0.85; }
.marker.m-event .marker-cap { background: #c98a5b; }

/* ---- legend pane (right) ---- */
.legend-pane {
  border-left: 1px solid var(--line);
  background: #fafaf7;
  padding: 16px;
  overflow-y: auto;
}
.legend-pane h3 {
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.1em;
  color: var(--ink-mute); margin: 0 0 12px;
}
.legend-item {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 8px 0;
  border-bottom: 1px solid #f2f2ec;
  font-size: 12px;
}
.legend-item:last-child { border-bottom: none; }
.legend-swatch {
  flex: 0 0 4px;
  height: 24px;
  margin-top: 2px;
  border-radius: 2px;
}
.legend-swatch.m-deadline { background: var(--warn); }
.legend-swatch.m-milestone { background: #2c5f5d; }
.legend-swatch.m-holiday { background: repeating-linear-gradient(0deg, #c4477a 0, #c4477a 3px, transparent 3px, transparent 6px); }
.legend-swatch.m-event { background: #c98a5b; }
.legend-meta {
  color: var(--ink-mute); font-size: 11px; margin-top: 2px; font-variant-numeric: tabular-nums;
}
.legend-label { font-weight: 500; }

.loading { padding: 24px; color: var(--ink-mute); font-size: 14px; }

/* ---- mobile cards ---- */
.mobile-markers {
  padding: 16px;
  background: #fafaf7;
  border: 1px solid var(--line);
  border-radius: 4px;
  margin-bottom: 32px;
}
.mobile-markers h3 {
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.1em;
  color: var(--ink-mute); margin: 0 0 12px;
}
.mobile-marker-item {
  display: flex; gap: 10px; align-items: baseline;
  padding: 8px 0;
  font-size: 13px;
  border-bottom: 1px solid #f2f2ec;
}
.mobile-marker-item:last-child { border-bottom: none; }
.mobile-marker-item .date {
  color: var(--ink-mute);
  font-variant-numeric: tabular-nums;
  flex: 0 0 88px;
  font-size: 12px;
}
.mobile-marker-item .badge {
  font-size: 9px;
  padding: 2px 6px;
  border-radius: 2px;
  color: #fff;
  letter-spacing: 0.04em;
  flex: 0 0 auto;
  text-transform: uppercase;
}
.mobile-marker-item .badge.m-deadline { background: #c4477a; }
.mobile-marker-item .badge.m-milestone { background: #2c5f5d; }
.mobile-marker-item .badge.m-holiday { background: #c4477a; opacity: 0.6; }
.mobile-marker-item .badge.m-event { background: #c98a5b; }
.mobile-marker-item .label { flex: 1; }

.mobile-group-header {
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.1em;
  color: var(--ink-mute);
  margin: 28px 0 10px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--line);
  font-weight: 500;
}
.mobile-group-header:first-child { margin-top: 0; }

.mobile-task {
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 4px;
  margin-bottom: 8px;
  background: #fff;
}
.mobile-task .head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 4px;
}
.mobile-task .name {
  font-size: 15px;
  font-weight: 500;
  flex: 1;
  line-height: 1.3;
}
.mobile-task .status-pill {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 2px 8px;
  border-radius: 10px;
  flex: 0 0 auto;
}
.mobile-task .status-pill.s-done       { background: #d6e9d8; color: #2d6b3f; }
.mobile-task .status-pill.s-active     { background: #fde8c4; color: #8a5a1f; }
.mobile-task .status-pill.s-pending    { background: #ececec; color: #777; }
.mobile-task .status-pill.s-blocked    { background: #fad6d6; color: #8c2c2c; }
.mobile-task .dates {
  font-size: 12px;
  color: var(--ink-mute);
  font-variant-numeric: tabular-nums;
}
.mobile-task .progress {
  height: 4px;
  background: #ececec;
  border-radius: 2px;
  margin-top: 8px;
  overflow: hidden;
}
.mobile-task .progress-bar {
  height: 100%;
  background: var(--accent);
  transition: width 0.3s ease;
}
.mobile-task .progress-bar.s-blocked { background: #d68a8a; }
.mobile-task .progress-bar.s-done    { background: #6db58a; }
.mobile-task .progress-bar.s-pending { background: #ccc; }

@media (max-width: 768px) {
  .timeline-page { padding: 32px 20px; }
  .timeline-container { display: none; }
  .timeline-mobile { display: block; }
}
